Welcome! Log In Create A New Profile

Advanced

Re: Cheap SharePoint -> Wordpress fail-over help request

keith
October 11, 2011 09:26AM
On 11/10/2011 10:50, Igor Sysoev wrote:
> On Tue, Oct 11, 2011 at 10:39:43AM +0100, keith wrote:
>> 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.
>>
>> Thanks for looking.
>> Keith
>>
>> upstream primaryserver { server 10.1.1.1:80; }
>> upstream secondaryserver { server 10.1.1.2:80; }
>>
>> server
>> {
>> listen 80;
>> server_name _;
>> server_name_in_redirect off;
>>
>> location /
>> {
>> try_files @sharepoint @wordpress;
>> }
>> location @sharepoint
>> {
>> proxy_pass http://primaryserver;
>> proxy_set_header Host $host;
>> proxy_connect_timeout 3;
>> proxy_next_upstream error timeout;
>> }
>>
>> location @wordpress
>> {
>> proxy_pass http://secondaryserver;
>> proxy_set_header Host $host;
>> proxy_connect_timeout 3;
>> proxy_next_upstream error timeout;
>> }
>>
>> }
> "try_files" tries files, but not proxied requests.
> There are two way to fallback to backup servers:
>
> 1)
> upstream sharepoint {
> server primaryserver;
> server secondaryserver backup;
> }
>
> server {
> location / {
> proxy_pass http://sharepoint;
> proxy_set_header Host $host;
> proxy_connect_timeout 3;
> }
> }
>
> 2)
> server {
> location / {
> proxy_pass http://primaryserver;
> proxy_set_header Host $host;
> proxy_connect_timeout 3;
> proxy_intercept_errors on;
> error_page 502 504 @wordpress;
> }
>
> location @wordpress {
> proxy_pass http://secondaryserver;
> proxy_set_header Host $host;
> proxy_connect_timeout 3;
> }
> }
>
>
Cheers Igor, Option 2 seems to be working for us !! So thanks for the
quick answers. I think we just need to setup the correct error codes now.

Below is the current configuration that seems to be working.

upstream primaryserver { server 10.0.0.xx:80; }
upstream secondaryserver { server 10.0.0.xx:80; }

server
{
listen 80;
server_name www.somewebsites.com;
server_name_in_redirect off;

location /
{
proxy_pass http://primaryserver;
proxy_set_header Host $host;
proxy_connect_timeout 3;
proxy_intercept_errors on;
error_page 400 403 502 504 @wordpress;
}

location @wordpress
{
proxy_pass http://secondaryserver;
proxy_set_header Host $host;
proxy_connect_timeout 3;
}
}

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Cheap SharePoint -> Wordpress fail-over help request

keith October 11, 2011 05:42AM

Re: Cheap SharePoint -> Wordpress fail-over help request

Igor Sysoev October 11, 2011 05:52AM

Re: Cheap SharePoint -> Wordpress fail-over help request

keith October 11, 2011 09:26AM

Re: Cheap SharePoint -> Wordpress fail-over help request

splitice October 11, 2011 05:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 326
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