I created the Nginx Proxy Manager container and the Wordpress container using Docker. But when I set up the reverse proxy for the Wordpress container as usual (not Wordpress), I realized that Nginx is not properly proxying the static content (e.g. JS, CSS, images) of the source site (which is the service provided by the Wordpress container).
The browser's developer tools (F12) prompted the following:
Mixed Content: The page at 'https://myDomain/wp-admin/setup-config.php' was loaded over HTTPS, but requested an insecure script 'http://myDomain/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.0'. This request has been blocked; the content must be served over HTTPS.
It should be noted that my Wordpress container does not provide an HTTPS service, so it is in fact the Nginx service provided by the Nginx Proxy Manager that reverse proxies the HTTP service provided by the Wordpress container with running the HTTPS service itself.
After searching, I added the following code to the Advanced Options in the corresponding Proxy Host in Nginx Proxy Manager:
Custom Nginx Configuration
location / {
proxy_set_header X-Forwarded-Proto $scheme;
}
This does seem to be somewhat useful, at least being able to load images and stuff. But the problem is that what it loads is not Wordpress at all but the OpenResty welcome page.
I don't know what the problem is, I sincerely hope you can help me, if you would like more information to solve the problem please let me know, thanks.
Note:
I used the following container image:
jc21/nginx-proxy-manager:latest
wordpress:latest