在我的NGINX配置中,WordPress博客位于私人服务器上.我的NGINX公共服务器代理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;
}
Run Code Online (Sandbox Code Playgroud)
在调用域和子目录时,博客完美呈现.引发wp-login 不会生成重定向 GET字段.
https://www.example.com/blog/wp-login.php
我的siteurl和我的home变量都设置为带子目录的域.
但是,成功登录后,我可能会看到仪表板,但浏览器中的URL会被重写为https://www.example.com/wp-admin,从而导致使用仪表板时出现问题.
虽然博客位于代理私有服务器上,但如何配置WP以重写URL到子目录?
(服务器中的子目录是否必须对称?)