Join the community today
Register Now

Nginx LetsEncrypt Error

Discussion in 'Beta release code' started by cloud9, Jan 9, 2024.

  1. cloud9

    cloud9 Premium Member Premium Member

    424
    117
    43
    Oct 6, 2015
    England
    Ratings:
    +217
    Local Time:
    8:58 PM
    1.25.3
    10.6.x
    How would I find this ??

    If you remember back I had a domain wwwD that was fine and then redirected to wwwD and I couldn't find out why - nothing changed at dns and a cmm update fixed it - would this also be something fishy concerning the above if another host is grabbing my new domain created with option 22 ?

     
  2. eva2000

    eva2000 Administrator Staff Member

    52,657
    12,071
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,597
    Local Time:
    5:58 AM
    Nginx 1.25.x
    MariaDB 10.x
    You can inspect all your nginx vhost and config by doing a full nginx config test output (-T) to a file and inspect that nginx-config-test.txt file - I wouldn't share this publicly as it would have sensitive info. Using -T will output contents of all nginx vhosts and nginx.conf and other config files.
    Code (Text):
    nginx -q -T 2>&1 | tee nginx-config-test.txt
    

    Pay attention to server{} context's listen and server_name directive values to see if there's duplicates or overlaps. You can use command below to do a quick filter for those 2 values as well
    Code (Text):
    nginx -q -T | egrep -v 'fastcgi_param|server_name_in_redirect|server_names|#|sn=' | egrep -in 'listen|server_name'

    example on fresh Centmin Mod install with no vhosts added defaults
    Code (Text):
    nginx -q -T | egrep -v 'fastcgi_param|server_name_in_redirect|server_names|#|sn=' | egrep -in 'listen|server_name'
    343:            listen   80;
    344:            server_name demodomain.com;
    350:            listen   80;
    351:            server_name www.demodomain.com;
    459:            listen 80 default_server backlog=262140;
    460:            server_name mainhostnamedomain;
    

    Note if you have any older nginx vhosts with no mention of listen 80 port and only server_name listed, then absence of listen 80 directive is same as listen 80 set defaults. So if you have 2 nginx vhost configs one with listen 80 and one without and both list server_name value = domain.com, then you'd get duplicate directive warning (not error) as they're essentially the same when non-HTTPS port 80 requests go to domain.com, it would match on both nginx vhosts AFAIK
     
  3. cloud9

    cloud9 Premium Member Premium Member

    424
    117
    43
    Oct 6, 2015
    England
    Ratings:
    +217
    Local Time:
    8:58 PM
    1.25.3
    10.6.x
    the last command to see if duplicates or overlaps - every www site has an 80 and an 443 as per it should be

    Will now examine the config file generated in the first command you gave

    Thankyou
     
  4. cloud9

    cloud9 Premium Member Premium Member

    424
    117
    43
    Oct 6, 2015
    England
    Ratings:
    +217
    Local Time:
    8:58 PM
    1.25.3
    10.6.x
    Hmm Not good, looking at nginx-config-test.txt

    Each domain is in the correct section

    I cant see any problems with it :(

    So still no further forward