Multiple SSL web sites with nginx

Bee.Lists bee.lists at gmail.com
Mon Jul 13 00:41:22 UTC 2020


> On Jul 12, 2020, at 3:08 PM, Ian Hobson <hobson42 at gmail.com> wrote:
> 
> This is not correct, see https://nginx.org/en/docs/http/ngx_http_core_module.html#server where it says
> 
> Syntax:	server { ... }
> Default:	—
> Context:	http
> Sets configuration for a virtual server. There is no clear separation between IP-based (based on the IP address) and name-based (based on the “Host” request header field) virtual servers. Instead, the listen directives describe all addresses and ports that should accept connections for the server, and the server_name directive lists all server names.
> 
> So the ports are defined in the listen directive, and the server names in the server_name directive.
> 
> Your approach of multiple https servers works fine on my kit with the approach you have taken.
> 
> Suggest there may be a typo in your configuration - try
> 
> sudo nginx -t
> 
> to prove both servers are loaded.


They are both on the same server.  Same IP.  With the same port number, there’s nothing deciphering between the two other than server_name.  Hence using server_name as the forward.  I don’t even know how one could use port number as the request.  

If you look at the example he posted, there was no default.   


Cheers, Bee






More information about the nginx mailing list