Staging a new community: Basic Auth breaks WP-Discourse plugin

Thanks, this clue helped me solve the issue. Here is the updated basic auth section of app.yml on my Discourse server (no changes were necessary on the Wordpress server):

# basic auth
  after_bundle_exec:
    - replace:
       filename: "/etc/nginx/conf.d/discourse.conf"
       from: "# Allow bypass cache from localhost"
       to: |
            # Allow bypass basic authentication for WP-Discourse plugin
            geo $authentication {
            default "Credentials you must provide.";
            127.0.0.1 "off";
            151.101.3.55/32 "off";
            }
            # Allow bypass cache from localhost
    - replace:
       filename: "/etc/nginx/conf.d/discourse.conf"
       from: "# auth_basic on"
       to: "auth_basic $authentication"
    - replace:
       filename: "/etc/nginx/conf.d/discourse.conf"
       from: "# auth_basic_user_file /etc/nginx/htpasswd"
       to: "auth_basic_user_file /etc/nginx/htpasswd"
    - replace:
       filename: "/etc/nginx/conf.d/discourse.conf"
       from: "location = /srv/status {"
       to: "location = /srv/status {
           auth_basic off;"
    - file:
       path: "/etc/nginx/htpasswd"
       contents: |
         alfred:$apr1$jSdLuHyZ$faWxYGjnmLd/zRC6UMsRs1

151.101.3.55 is the (example) public IP address of my Wordpress server. WP-Discourse now reports:
A blank screen displays the green-bordered text, "You are connected to Discord!" (Captioned by AI)

2 Likes