Forum: NGINX Proxying with/without listen in server block

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tcbarrett (Guest)
on 2013-08-14 11:09
(Received via mailing list)
Does having a listen directive in a server block over ride blocks
without?

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

Something a bit like this: http://pastebin.com/MSAFJKLV

The middle block hogs all the traffic, and all requests are sent to
mysssl.example.com.

What am I missing?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,241824,241824#msg-241824
2974d09ac2541e892966b762aad84943?d=identicon&s=25 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
test
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
get
the captures."

http://nginx.org/en/docs/http/server_names.html

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,241824,241826#msg-241826
36a8284995fa0fb82e6aa2bede32adac?d=identicon&s=25 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:

http://nginx.org/en/docs/http/request_processing.h...

coupled with the default value for "listen", as in "what is meant by not
having a listen in a server block", which is at
http://nginx.org/r/listen

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".

  f
--
Francis Daly        francis@daoine.org
This topic is locked and can not be replied to.