Forum: NGINX Proxying with/without listen in server block

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
tcbarrett (Guest)
on 2013-08-14 11:09
(Received via mailing list)
Does having a listen directive in a server block over ride blocks

I have a slightly complex set up, proxying traffic depending on url to
various other machines on the network.

Something a bit like this:

The middle block hogs all the traffic, and all requests are sent to

What am I missing?

Posted at Nginx Forum:,241824,241824#msg-241824
tcbarrett (Guest)
on 2013-08-14 11:49
(Received via mailing list)
Am I missing this:

"If a server is the only server for a listen port, then nginx will not
server names at all (and will not build the hash tables for the listen
port). However, there is one exception. If a server name is a regular
expression with captures, then nginx has to execute the expression to
the captures."

Posted at Nginx Forum:,241824,241826#msg-241826
Francis Daly (Guest)
on 2013-08-14 12:51
(Received via mailing list)
On Wed, Aug 14, 2013 at 05:48:38AM -0400, tcbarrett wrote:

Hi there,

> Am I missing this:

I think you're missing this:

coupled with the default value for "listen", as in "what is meant by not
having a listen in a server block", which is at

The answer to your original question:

> Does having a listen directive in a server block over ride blocks without?

is "yes, if the listen directive is different from the default".

Francis Daly
This topic is locked and can not be replied to.