In my NGINX configuration, a WordPress blog is on a private server. My NGINX public server proxies the private server's content for https://www.example.com/blog/.
location ^~ /blog/ { # A "subdirectory", hiding a proxied server
proxy_pass http://192.168.0.5:80/; # The blog resides in the
# private's web root,
# not in a subdirectory
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
}
The blog is perfectly rendered on calling the domain and subdirectory. Bringing up wp-login does not generate a redirect GET field.
https://www.example.com/blog/wp-login.php
My siteurl and my home variables are both set to the domain with subdirectory.
However, after a successful login, I may see the dashboard, but the URL in my browser gets rewritten to https://www.example.com/wp-admin, causing problems on using the dashboard.
How do I configure WP to rewrite the URL to the subdirectory, although the blog is on a proxied private server?
(Do the subdirectories in the servers have to be symmetrical?)