wordpress behind nginx proxy (acces from two sources)

admin

Administrator
Staff member
I had a hard search finding out how to get Word-press to show its page behind a proxy, i figured out a way to get the page-links and style-files loaded correctly, but the admin-pages throw 404 if i try to use anything within them. <strong>after rebuilding the docker-compose, admin-page works</strong>
<strong>The current need to set WP_HOME and url, have the problem tat i can only decide if the page works in my network (by using the IP) or is reachable from the outside (by setting the url)</strong>

My change to the wp-config.php was to add:

Code:
define('WP_HOME','http://192.168.1.108/wordpress');
define('WP_SITEURL','http://192.168.1.108/wordpress');

the ngings location is:

Code:
location /wordpress/{
  proxy_buffering off;
  proxy_pass http://wordpress/;
  proxy_redirect default;
}

192.168.1.108 is the ip to reach nginx which uses the docker-container name "<a href="http://wordpress/" rel="nofollow noreferrer">http://wordpress/</a>" to reach wordpress.<strong>deleted some false entrys here</strong>

PS: This is basically a followup to <a href="https://stackoverflow.com/questions...ing-nginx-as-proxy-to-another-webserver-on-pi">docker running nginx as proxy to another webserver (on pi)</a>.

-- EDIT --:
Some tests (and system restart) have changed some of tha above statements, they were changed to acomodate this, <strong>edits in bold</strong>.

-- EDIT 2--:
I know one solution is to add the outside-URL to the hosts.txt (i use it on the device the site itself is running on) but tis wont help with mobile devices (which need to use both inside and ourtside IP).

-- EDIT 3--:
Ok, now i managed to double my prepends whenever i try to enter a php generated page:
I get http:///wordpress//wordpress/wp-admin/ same goes for comments. But login seems to work normal (altough it also is a php)?