nginx doesn't listen on port 80 twice?

后端 未结 4 1443
离开以前
离开以前 2020-12-11 09:34

Edit: Read this, first:

Apart from the accepted answer, these errors occur when nginx is started without systemd. Kill nginx: ps -ax | grep nginx

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-11 10:14

    I came to this issue when I config three host name on one IP.

    I use a free ssl cercificate which can only sign on one hostname. So I apply three ssl certificates.

    server {
        listen      443 backlog=50000;
        server_name example1.com;
    
    server {
        listen       443;
        server_name  example2.com;
    
    server {
        listen       443  backlog=50000;
        server_name  example3.com;
    

    When I use nginx -t to test the config file, it shows

    nginx: [emerg] duplicate listen options for 0.0.0.0:443 in /etc/nginx/conf.d/example1_https.conf:2

    nginx: configuration file /etc/nginx/nginx.conf test failed

    I fixed it by remove the backlog=50000 from the example3.com

提交回复
热议问题