I have a landing page and a wordpress site in a subfolder
example.com -> landing page
example.com/blog -> wordpress
I want to serve the wordpress site on a different server. I created a server( blog.example.com) and moved all files and databases that belong to wordpress. I have changed nginx configuration (example.com) a bit and added those lines below
location /blog {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass https://blog.example.com:443 ;
}
Now, Any user heading to example.com/blog/posts
sees the content on blog.example.com/blog/posts
without redirecting to blog.example.com
. But after loading the first page (posts) when he clicks any link , he is redirected to blog.example.com
, which is not desired action.
I have to set siteurl and home as blog.example.com on blog.example.com. Because If I set siteurl and home as example.com/blog
, it redirects to example.com when the first page is loaded .
So how can I serve a wordpress site in a subfolder proxied on different server?