Welcome! Log In Create A New Profile

Advanced

Proxy_store as a backup for upstream servers

Posted by santtub 
Proxy_store as a backup for upstream servers
April 04, 2012 05:47AM
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
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 116
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready