• Reverse proxy works fine overall but when logging on the Admin, tons of missing Jquery console errors show up.

    The culprit seemed to be load-scripts.php as it seems to be the one loading jquery, and even though request goes through with a 200, it returns 0 byte.

    Here’s the error I could see in Apache error_log:

    AH01071: Got error 'PHP message: PHP Notice: Undefined index: load in /opt/bitnami/apps/wordpress/htdocs/wp-admin/load-scripts.php on line 23', referer: https://www.domain.com/blog/wp-admin/

    After much fiddling around I was able to get it working by putting define( 'SCRIPT_DEBUG', true ); in wp-config.php.

    With this WP-Admin works as well, but it seems like a bad hack to have to do this and this is really not documented. I was pretty lucky to find this out.

    What needs to be configured to get wp-admin/load-scripts.php working behind an Nginx reverse proxy?

    Here’s the nginx proxy config snippet in place:

    
    location ~* /blog/(.*) {
        resolver 1.1.1.1;
        set $blog_host wp.domain.com;
        proxy_pass https://$blog_host/$1;
        proxy_cookie_domain $blog_host $host;
        proxy_redirect off;
    
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_ssl_session_reuse on;
    }
    

    (proxying website and target WP instance are both full HTTPS)

    After getting this to work, I also have a 400 error on a GET request on admin-ajax.php

    GET wp-admin/admin-ajax.php?action=dashboard-widgets&widget=dashboard_primary&pagenow=dashboard

    For some reason there’s also a successful POST on the same resource, making me doubt whether this problem is due to my setup,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Have you looked in the apache logs (I assume you’re reverse proxying to an apache instance) for error messages?

    Thread Starter coolnodje

    (@coolnodje)

    You’re right to assume Nginx reverse proxy to an Apache instance (I use the Bitnami image).

    As I said in the original post, here’s the only error log I get from Apache:

    
    AH01071: Got error 'PHP message: PHP Notice: Undefined index: load in /opt/bitnami/apps/wordpress/htdocs/wp-admin/load-scripts.php on line 23', referer: https://www.domain.com/blog/wp-admin/
    

    Note: https://www.domain.com/blog/ is the value of WP_HOME and WP_SITEURL

    Thread Starter coolnodje

    (@coolnodje)

    I’m having other issues with this setup, otherwise working very well.

    I can’t update WP or Themes (Plugins can be updated, but not from the Dashboard)

    It works fine when I revert WP_SITEURL and WP_HOME to the hosting server instead of the Nginx reverse proxying main website.

    The only thing I can see in all the logs (no error logged at all) is that all POST issued from the updated are done in HTTP 1.0.
    I’m not sure if it could cause the issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP-Admin issues with WP behind Nginx reverse proxy’ is closed to new replies.