Welcome! Log In Create A New Profile

Advanced

Re: how to make nginx loadbalancer give 404 when all upstream servers are down

Francis Daly
August 14, 2015 03:56AM
On Fri, Aug 14, 2015 at 02:06:29AM -0400, karkunpavan wrote:

Hi there,

> Thanks for taking a look. With it curl behaves as expected, but with tools
> like ab and httperf, I am not seeing bad gateway responses when both the
> upstream servers are down.

> ab:
>
> When one upstream server is up:
>
> nginx console:
> <<client_IP>> - - [14/Aug/2015:13:44:57 +0000] "GET / HTTP/1.0" 200 45 "-"
> "ApacheBench/2.3"

Response status 200, content size 45.

> When both upstream servers are down:
>
> <<client_IP>> - - [14/Aug/2015:13:43:45 +0000] "GET / HTTP/1.0" 502 172 "-"
> "ApacheBench/2.3"

Response status 502, content size 172.

> as a result in bith cases ab just shows all successful responses:
> # ab -n 1 -c 1 http://<nginx_IP>:<port>/

> Server Port: 9000
> Complete requests: 1
> Failed requests: 0
> HTML transferred: 45 bytes

One request, 45 bytes of content. That is the "success" case.

If the "fail" case shows the same, while the nginx logs show something
else, then your testing tool is wrong.

> Any suggestions what I might be doing wrong?

ab is talking to port 9000.

Your previous config showed nginx listening on port 8000.

Might that be related?

f
--
Francis Daly francis@daoine.org

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

how to make nginx loadbalancer give 404 when all upstream servers are down

karkunpavan August 13, 2015 05:12AM

Re: how to make nginx loadbalancer give 404 when all upstream servers are down

Francis Daly August 13, 2015 07:14AM

Re: how to make nginx loadbalancer give 404 when all upstream servers are down

karkunpavan August 14, 2015 02:06AM

Re: how to make nginx loadbalancer give 404 when all upstream servers are down

itpp2012 August 14, 2015 03:12AM

Re: how to make nginx loadbalancer give 404 when all upstream servers are down

karkunpavan August 14, 2015 03:45AM

Re: how to make nginx loadbalancer give 404 when all upstream servers are down

Francis Daly August 14, 2015 03:56AM

Re: how to make nginx loadbalancer give 404 when all upstream servers are down

karkunpavan August 14, 2015 04:17AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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