Virtualmin + Nginx + SSL-Setup-Fehler mit Cloudflare 521

Virtualmin + Nginx + SSL-Setup-Fehler mit Cloudflare 521

Betriebssystem: Ubuntu 20.04 Installiertes Virtualmin + Nginx + PHP-FPM

Alles war gut eingerichtet, aber als ich das 3-monatige SSL-Testzertifikat (vollständig gültiges Zertifikat) installierte, das nicht von Letsencrypt stammte (Limit erreicht), funktionierte alles einwandfrei. Als ich jedoch zu Cloudflare wechselte, stürzte meine Website mit der Meldung „521 Server nicht gefunden“ ab. Ich habe versucht, auf eine andere Option wie „Flexibel“, „Vollständig“ oder „Vollständig (streng)“ umzusteigen, aber ohne Erfolg.

Befehl

tail -f /var/log/nginx/error.log

habe eine Reihe von Fehlern in der Protokolldatei.

root@server:~# tail -f /var/log/nginx/error.log

2020/12/29 21:59:05 [emerg] 6813#6813: bind() to 2xx.2xx.xx3.xxx:443 failed (98: Address already in use)

2020/12/29 21:59:05 [emerg] 6813#6813: bind() to [2xxx:a1xx:xxxx:8xxx::1]:443 failed (98: Address already in use)

2020/12/29 21:59:05 [emerg] 6813#6813: still could not bind()

2020/12/29 22:31:47 [emerg] 512#512: cannot load certificate “/home/example/ssl.cert”: BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(’/home/example/ssl.cert’,‘r’) error:2006D080:BIO routines:BIO_new_file:no such file)

2020/12/29 22:32:37 [emerg] 1986#1986: cannot load certificate “/home/example/ssl.cert”: BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(’/home/example/ssl.cert’,‘r’) error:2006D080:BIO routines:BIO_new_file:no such file)

2020/12/29 23:58:45 [alert] 12025#12025: *1168 open socket #17 left in connection 93

2020/12/29 23:58:45 [alert] 12025#12025: aborting

Ich bin ziemlich sicher, dass diese SSL-Dateien da sind, aber Nginx denkt etwas anderes ;(

Dies ist die Ausgabe, die ich erhalte

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      678/mysqld          
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      1722/master         
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      787/dovecot         
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      787/dovecot         
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      19353/perl          
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      19330/nginx: master 
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      1722/master         
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      15079/systemd-resol 
tcp        0      0 207.244.253.107:53      0.0.0.0:*               LISTEN      575/named           
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      575/named           
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      630/sshd: /usr/sbin 
tcp        0      0 127.0.0.1:11000         0.0.0.0:*               LISTEN      1044/lookup-domain- 
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1722/master         
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      575/named           
tcp        0      0 207.244.253.107:443     0.0.0.0:*               LISTEN      19330/nginx: master 
tcp        0      0 0.0.0.0:20000           0.0.0.0:*               LISTEN      19398/perl          
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      787/dovecot         
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      787/dovecot         
tcp        0      0 127.0.0.1:33060         0.0.0.0:*               LISTEN      678/mysqld          
tcp        0      0 127.0.0.1:10023         0.0.0.0:*               LISTEN      542/postgrey --pidf 
tcp6       0      0 :::587                  :::*                    LISTEN      1722/master         
tcp6       0      0 :::2222                 :::*                    LISTEN      8361/proftpd: (acce 
tcp6       0      0 :::110                  :::*                    LISTEN      787/dovecot         
tcp6       0      0 :::143                  :::*                    LISTEN      787/dovecot         
tcp6       0      0 :::10000                :::*                    LISTEN      19353/perl          
tcp6       0      0 :::80                   :::*                    LISTEN      19330/nginx: master 
tcp6       0      0 :::465                  :::*                    LISTEN      1722/master         
tcp6       0      0 :::21                   :::*                    LISTEN      8361/proftpd: (acce 
tcp6       0      0 ::1:53                  :::*                    LISTEN      575/named           
tcp6       0      0 :::22                   :::*                    LISTEN      630/sshd: /usr/sbin 
tcp6       0      0 :::25                   :::*                    LISTEN      1722/master         
tcp6       0      0 ::1:953                 :::*                    LISTEN      575/named           
tcp6       0      0 :::993                  :::*                    LISTEN      787/dovecot         
tcp6       0      0 :::995                  :::*                    LISTEN      787/dovecot         
tcp6       0      0 ::1:10023               :::*                    LISTEN      542/postgrey --pidf 
root@server:~# 

Und ja, die Dateien sind da und die Berechtigung ist auf chmod 600 gesetzt

Danke

Antwort1

Zuerst lauschen einige Programme auf Port 443. Mit netstat -ltnpdem Befehl können Sie herausfinden, welches Programm auf Port 443 lauscht. Wenn Netstat Ihren Server nicht findet, installieren Sie das Net-Tools-Paket.

Zweitens kann nginx nicht auf Ihr Zertifikat zugreifen. /home/example/ssl.cert Überprüfen Sie, ob diese Zertifikate vorhanden sind. Wenn sie vorhanden sind, überprüfen Sie die Dateiberechtigung.

verwandte Informationen