SatelliteWP / rocket-nginx

Rocket-Nginx is a Nginx configuration that makes WP-Rocket even faster by serving static pages directly without loading WordPress or PHP.
MIT License
579 stars 129 forks source link

Different servers with Reverse Proxy to Single Domain Setup Help #208

Closed pappinvijak closed 6 months ago

pappinvijak commented 6 months ago

Hi, Thank you so much for the repository, it works really great. However, I am facing a certain issue while in reverse proxying.

  1. I am having a website (example.com) at a server1 where rocket-nginx works great.

  2. Additionally, I have 3 separate servers (server 2, server 3, server 4) configured to separate subdomains (category1.example.com, category2.example.com, category3.example.com) which have separate WordPress installations with Nginx and rocket-nginx. These subdomains are reversed proxied by the main server in point 1 to show them as subdirectories like (example.com/category1, example.com/category2, example.com/category3). I am having this setup working fine where the subdirectories cache is always getting missed because the cache files are not getting created in their own respective servers because of reverse proxy.

So, please let me know if there is any way to fix this, any small suggestions are very much appreciated.

Thank you

maximejobin commented 6 months ago

For your point 2, Rocket-Nginx needs to be configured on Server 2, Server 3 and Server 4. I would test them without calling them with subdirectories. Once this works, your reverse proxy (even with altering the path) should work.

I should say: it should work.

This is a scenario I haven't tested but your other servers should not have to worry about the URL rewrite. Therefore, Rocket-Nginx should be able to work out of the box.

pappinvijak commented 6 months ago

Hi, thank you so much. Will try this