I have a setup that is presented below:
domain_name -> nginx_ip_address -> wordpress_blog_ip_address
Where when a user visits "/blog", nginx forwards the request to a seperate ip address of a machine running a wordpress blog.
The problem is that when the user clicks on a post in the blog, the url will show as: "wordpress_blog_ip_address/post" and not "domain_name/blog/post". How can I fix this?
My current nginx file is below:
server {
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /blog {
proxy_pass http://new_ip_address/;
proxy_set_header Host $host;
}
}