Welcome! Log In Create A New Profile

Advanced

Re: Multiple SSL web sites with nginx

Ian Hobson
July 12, 2020 03:10PM
On 12/07/2020 17:43, Bee.Lists wrote:
>
>> On Jul 12, 2020, at 9:43 AM, dorafmon <nginx-forum@forum.nginx.org> wrote:
>>
>> I am trying to host multiple web apps on the same machine and they are all
>> SSL enabled. I am trying to put an Nginx server in front of them to redirect
>> incoming requests to different ports.
>
> The domain carried forward is what nginx uses to decipher what vhost to return. Also, both of those domains are port 443, so it will go to the first/default domain.
>
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.


Regards

Ian

--
Ian Hobson
Tel (+351) 910 418 473

--
This email has been checked for viruses by AVG.
https://www.avg.com

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

Multiple SSL web sites with nginx

dorafmon July 12, 2020 09:43AM

Re: Multiple SSL web sites with nginx

daBee July 12, 2020 12:44PM

Re: Multiple SSL web sites with nginx

Ian Hobson July 12, 2020 03:10PM

Re: Multiple SSL web sites with nginx

daBee July 12, 2020 08:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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