Join the community today
Become a Member

Nginx (RESOLVED)nginx: [emerg] duplicate listen options for 0.0.0.0:443

Discussion in 'Install & Upgrades or Pre-Install Questions' started by EckyBrazzz, Oct 4, 2019.

  1. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    1:04 PM
    1.17.x Cluster
    10.3.x Cluster & Redis
    Resolved an issue get the next one. Same setup worked on other server

    Code (Text):
    nginx -t
    nginx: [emerg] duplicate listen options for 0.0.0.0:443 in /usr/local/nginx/conf/conf.d/domain.com.ssl.conf:16
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    


    ssl.conf

    Code (Text):
    #x# HTTPS-DEFAULT
    # server {
    #
    #   server_name domain.com www.domain.com;
    #   return 302 https://domain.com$request_uri;
    #   include /usr/local/nginx/conf/staticfiles.conf;
    # }
    map $uri $blogname{
    ~^(?<blogpath>/[^/]+/)sites/(.*)    $blogpath ;
    }
    map $blogname $blogid{
        default -999;
            include /home/nginx/domains/domain.com/public/wp-content/uploads/domain-helper/map.conf;
    }
    server {
      listen 443 ssl http2 reuseport;
      server_name domain.com sub1.domain.com sub2.domain.com <<SNIPPED>>$
    
     
  2. rdan

    rdan Well-Known Member

    4,671
    1,121
    113
    May 25, 2014
    Ratings:
    +1,663
    Local Time:
    12:04 AM
    Mainline
    10.2
    Must be use only once.
     
    • Like Like x 1
  3. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    1:04 PM
    1.17.x Cluster
    10.3.x Cluster & Redis
    @rdan Thx, don't know what is different on the other server, it's a one-to-one copy that worked before.
     
  4. eva2000

    eva2000 Administrator Staff Member

    41,727
    9,396
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,432
    Local Time:
    2:04 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    reuseport can only be used on one ip / port pairing so ip / 80 and ip / 443 and then applies to all sites on same ip / port pairing.

    As such centmin.sh menu option 2 and 22 automatically check if the any sites in /usr/local/nginx/conf/conf.d/ directory list of nginx vhosts already have reuseport listen directive set first and then for centmin.sh site you're creating on ip / 443 for HTTPS site it will automatically append reuseport to listen directive if you don't have any existing HTTPS site with reuseport and only.

    now if you copied nginx vhost from another centmin mod server, then there is no check for duplicate reuseport directive hence duplicate listen option error you have
     
  5. EckyBrazzz

    EckyBrazzz Active Member

    699
    139
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +258
    Local Time:
    1:04 PM
    1.17.x Cluster
    10.3.x Cluster & Redis
    It's the wp-multisite, so I thought, no need to figure out these settings and just deleted the old content and replaced it.