Try files refers to local files so that wont work. You need a failover in the upstream.<br><br><div class="gmail_quote">On Tue, Oct 11, 2011 at 8:39 PM, keith <span dir="ltr"><<a href="mailto:keith@scott-land.net">keith@scott-land.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">We have nginx setup as a reverse proxy and on one of the backend servers we have a Sharepoint website that we want to failover to a Wordpress website hosted on another server if there's a problem with Sharepoint website. I've googled and red through books etc but can't we an example for this. I think i need "try_files" and some type of error code checking but havent been able to figure it out. Could someone advice ? Below is the type of thing that I think I am after.<br>
<br>
Thanks for looking.<br>
Keith<br>
<br>
upstream primaryserver { server <a href="http://10.1.1.1:80" target="_blank">10.1.1.1:80</a>; }<br>
upstream secondaryserver { server <a href="http://10.1.1.2:80" target="_blank">10.1.1.2:80</a>; }<br>
<br>
server<br>
{<br>
listen 80;<br>
server_name _;<br>
server_name_in_redirect off;<br>
<br>
location /<br>
{<br>
try_files @sharepoint @wordpress;<br>
}<br>
location @sharepoint<br>
{<br>
proxy_pass <a href="http://primaryserver" target="_blank">http://primaryserver</a>;<br>
proxy_set_header Host $host;<br>
proxy_connect_timeout 3;<br>
proxy_next_upstream error timeout;<br>
}<br>
<br>
location @wordpress<br>
{<br>
proxy_pass <a href="http://secondaryserver" target="_blank">http://secondaryserver</a>;<br>
proxy_set_header Host $host;<br>
proxy_connect_timeout 3;<br>
proxy_next_upstream error timeout;<br>
}<br>
<br>
}<br>
<br>
______________________________<u></u>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/<u></u>mailman/listinfo/nginx</a><br>
</blockquote></div><br>