WordPress with Nginx proxy pass not loading resources

I just migrate from blog.example.com to www.example.com/blog and just adding this configuration on my nginx:

location ~ /blog(/.*) {
 proxy_pass http://public-ip; #server IP where the wordpress installed
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

and then I change the wordpress setting for WordPress Address (URL) and Site Address (URL) from blog.example.com to www.example.com/blog

Read More

When I check the www.example.com/blog, the post list, post view and pagination works well. But the resources (css, js & images) not loaded at all.

Please note my nginx server used for load balancer for my web app (www.example.com) and the wordpress app (blog) in another server.

Am I missing something on the nginx configuration or maybe in the wordpress setting?

thanks a lot

Related posts