Welcome! Log In Create A New Profile

Advanced

how proxy_next_upstream control retry times

李文伟
February 05, 2013 10:52PM
hi:
now i am looking for a 50x retry method, config like this:



upstream jboss8080 {
server 10.1.2.164:8080 weight=1 max_fails=1
fail_timeout=2s;
server 10.1.2.174:8080 weight=1 max_fails=1
fail_timeout=2s;
server 10.1.2.209:8080 weight=1 max_fails=1
fail_timeout=2s;
server 10.1.7.136:8080 weight=1 max_fails=1
fail_timeout=2s;
server 10.1.7.137:8080 weight=1 max_fails=1
fail_timeout=2s;
server 10.1.7.138:8080 weight=1 max_fails=1
fail_timeout=2s;
}

server {
.........
location / {
proxy_next_upstream http_500 http_502 http_503 http_504 timeout error
invalid_header;
........
if ( !-f $request_filename ) {
proxy_pass http://jboss8080;
break;
}
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}


then how proxy_next_upstream control retry times.


by the way, i used error_page, config like this:


upstream backend {
server localhost:8080 weight=5;
}

upstream backup1 {
server localhost:8081 weight=5;
}

upstream backup2 {
server localhost:8082 weight=5;
}

server {
listen 80;
server_name localhost;
proxy_intercept_errors on;

location / {
error_page 502 @backup1;
proxy_pass http://backend;
}

location @backup1 {
error_page 502 @backup2;
proxy_pass http://backup1;
}

location @backup2 {
proxy_pass http://backup2;
}
}

@backup1works, but @backup2 doesn't.
how can i let backup2 works.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

how proxy_next_upstream control retry times

李文伟 February 05, 2013 10:52PM

Re: how proxy_next_upstream control retry times

Maxim Dounin February 06, 2013 05:48AM

Re: how proxy_next_upstream control retry times

李文伟 February 06, 2013 10:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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