Hi,
I've been trying to configure local mirror (by using proxy_store) as a backup for upstream servers. Proxy_store is working nicely and it is storing pages loaded from the upstream servers.
If both of the upstream servers are dead, then Nginx should serve pages from its local storage. I haven't been able to figure out how to configure this.
I've tried the following configs:
1.
- Add error_page 502 503 504 = @fetch to the location
- Create @fetch location and set this location's root to proxy_store path
2.
- Create additional load balancing group that has localhost as the only server in it
- Add error_page 502 503 504 = @fetch to the location
- Create @fetch location and set its proxy_pass to the load balancing group where the localhost is
The example in Nginx's documentation [1] is not suitable for my case, because my config tries first to connect to the upstream and if that fails then it should use locally stored files from proxy_store.
I'm running Nginx 1.0.14.
Ideas?
[1] http://wiki.nginx.org/HttpProxyModule#proxy_store