Virtual hosts sharing same port

Frank Liu gfrankliu at gmail.com
Mon Apr 16 15:13:42 UTC 2018


Does that mean nginx will read and combine listen options from all virtual hosts and use that to create listening socket? 

> On Apr 16, 2018, at 8:04 AM, Peter Booth <peter_booth at me.com> wrote:
> 
> Does this imply that that different behavior *could* be achieved by first defining virtual IP addresses (additional private IPs defined at the OS) which were bound to same physical NIC, and then defining virtual hosts that reference the different VIPs, in a similar fashion to how someone might configure a hardware load balancer?
> 
> 
> 
> Sent from my iPhone
> 
>> On Apr 16, 2018, at 9:32 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>> 
>> Hello!
>> 
>>> On Mon, Apr 16, 2018 at 07:26:11AM +0000, Frank Liu wrote:
>>> 
>>> Can I use different listen parameters for virtual hosts using the same
>>> port? Eg, one vh has “listen 443 ssl;” and the other one has “listen 443
>>> ssl h2;”
>> 
>> No.  Options like "ssl" and "h2" can be repeated multiple times to 
>> make configuring listening sockets more clear.  But whenever you 
>> set it or not in a given server{} block, the listening socket in 
>> question will have the option set as long as it is set in at least 
>> one "listen" directive.
>> 
>> -- 
>> Maxim Dounin
>> http://mdounin.ru/
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


More information about the nginx mailing list