Welcome! Log In Create A New Profile

Advanced

Cant make Proxy Next Upstream work

Agus
October 05, 2015 03:56PM
Hi guys!

I have a configuration taht cant make it work Here is the data. First i
check taht if i come from location2 with geo so taht it uses lcoation 2
backends.. But as there are things taht are not in location2 i need to go
to default location in case there is an 404 o 403 as git shows me 403
although the repo doesnt exist.

This isnt working.. i receive the 403 form location2 but never tries the
backup server.. Any help or any other way to do it will greatly appreciate!

geo $upstream {
default git_loc1;

x.x.0.0/16 git_loc1;
x.x.0.0/16 git_loc2;
}

upstream git_loc1 {
hash $remote_addr$remote_user;

server git1.loc1.bla:443;
server git2.loc1.bla:443;
}

upstream git_loc2 {

server git.loc2.bla:443;

server git.loc1.bla:443 backup;
}


server {
listen 80;
server_name git.bla;

error_log logs/git-error.log debug;
access_log logs/git_access.log upstreamlog;

location / {
proxy_intercept_errors on;
error_log logs/git-pp-error.log debug;
proxy_next_upstream error http_403 http_404;
proxy_pass https://$upstream;
}

}


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

Cant make Proxy Next Upstream work

Agus October 05, 2015 03:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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