Назад | Перейти на главную страницу

NGinx перестает обслуживать после настройки HTTPS

Я создаю сервер Nginx в контейнере Docker. Этот контейнер предназначен для автоматического тестирования, и я провожу тесты E2E для него.

Я включил конфигурацию HTTPS с самоподписанным сертификатом, используя следующий файл nginx.conf

server {
    listen       80;
    server_name  localhost;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}
#https://localhost
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name localhost;

    server_tokens off;

    ssl_certificate /etc/nginx/conf.d/ssl.crt;
    ssl_certificate_key /etc/nginx/conf.d/ssl.key;

    ssl_buffer_size 8k;

    # ssl_dhparam /etc/ssl/certs/dhparam-2048.pem; can use a pem file here.

    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
    ssl_prefer_server_ciphers on;

    ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;

    ssl_ecdh_curve secp384r1;
    ssl_session_tickets off;

    # OCSP stapling
    # ssl_stapling on;
    # ssl_stapling_verify on;
    # resolver 8.8.8.8;

    #return 301 https://localhost$request_uri;
     location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

Я проверил журналы, и около некоторых подключений сервер перестает отвечать, и конец журналов выглядит как следующий. Оттуда, когда я пытаюсь подключиться к нему, журналы больше не создаются.

127.0.0.1 - - [28/Apr/2020:18:04:48 +0000] "GET /public/images/icons/n1_settings_economic.svg HTTP/1.1" 200 304 "https://0.0.0.0/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36" "-"
127.0.0.1 - - [28/Apr/2020:18:04:48 +0000] "GET /public/images/icons/n1_november_first_n.svg HTTP/1.1" 200 364 "https://0.0.0.0/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36" "-"
2020/04/28 18:04:50 [info] 10#10: *812 client closed connection while waiting for request, client: 10.240.255.55, server: 0.0.0.0:80
2020/04/28 18:04:50 [info] 10#10: *811 client closed connection while SSL handshaking, client: 10.240.255.55, server: 0.0.0.0:443
2020/04/28 18:04:50 [info] 10#10: *814 client closed connection while SSL handshaking, client: 10.240.255.56, server: 0.0.0.0:443
2020/04/28 18:04:50 [info] 10#10: *813 client closed connection while waiting for request, client: 10.240.255.56, server: 0.0.0.0:80
2020/04/28 18:04:56 [info] 10#10: *816 client closed connection while waiting for request, client: 10.240.255.55, server: 0.0.0.0:80
2020/04/28 18:04:56 [info] 10#10: *815 client closed connection while SSL handshaking, client: 10.240.255.55, server: 0.0.0.0:443
2020/04/28 18:04:56 [info] 10#10: *818 client closed connection while SSL handshaking, client: 10.240.255.56, server: 0.0.0.0:443
2020/04/28 18:04:56 [info] 10#10: *817 client closed connection while waiting for request, client: 10.240.255.56, server: 0.0.0.0:80
2020/04/28 18:05:02 [info] 10#10: *820 client closed connection while SSL handshaking, client: 10.240.255.55, server: 0.0.0.0:443
2020/04/28 18:05:02 [info] 10#10: *819 client closed connection while waiting for request, client: 10.240.255.55, server: 0.0.0.0:80
2020/04/28 18:05:02 [info] 10#10: *821 client closed connection while SSL handshaking, client: 10.240.255.56, server: 0.0.0.0:443
2020/04/28 18:05:02 [info] 10#10: *822 client closed connection while waiting for request, client: 10.240.255.56, server: 0.0.0.0:80
2020/04/28 18:05:08 [info] 10#10: *824 client closed connection while waiting for request, client: 10.240.255.55, server: 0.0.0.0:80
2020/04/28 18:05:08 [info] 10#10: *823 client closed connection while SSL handshaking, client: 10.240.255.55, server: 0.0.0.0:443
2020/04/28 18:05:08 [info] 10#10: *825 client closed connection while waiting for request, client: 10.240.255.56, server: 0.0.0.0:80
2020/04/28 18:05:08 [info] 10#10: *826 client closed connection while SSL handshaking, client: 10.240.255.56, server: 0.0.0.0:443
2020/04/28 18:05:14 [info] 10#10: *827 client closed connection while SSL handshaking, client: 10.240.255.55, server: 0.0.0.0:443
2020/04/28 18:05:14 [info] 10#10: *828 client closed connection while waiting for request, client: 10.240.255.55, server: 0.0.0.0:80
2020/04/28 18:05:14 [info] 10#10: *830 client closed connection while waiting for request, client: 10.240.255.56, server: 0.0.0.0:80
2020/04/28 18:05:14 [info] 10#10: *829 client closed connection while SSL handshaking, client: 10.240.255.56, server: 0.0.0.0:443
2020/04/28 18:05:17 [info] 10#10: *676 client 127.0.0.1 closed keepalive connection
2020/04/28 18:05:17 [info] 7#7: *675 client 127.0.0.1 closed keepalive connection
2020/04/28 18:05:17 [info] 10#10: *664 client 127.0.0.1 closed keepalive connection
2020/04/28 18:05:17 [info] 10#10: *663 client 127.0.0.1 closed keepalive connection
2020/04/28 18:05:17 [info] 10#10: *775 client 127.0.0.1 closed keepalive connection
2020/04/28 18:05:20 [info] 10#10: *832 client closed connection while waiting for request, client: 10.240.255.55, server: 0.0.0.0:80
2020/04/28 18:05:20 [info] 10#10: *831 client closed connection while SSL handshaking, client: 10.240.255.55, server: 0.0.0.0:443
2020/04/28 18:05:20 [info] 10#10: *833 client closed connection while waiting for request, client: 10.240.255.56, server: 0.0.0.0:80
2020/04/28 18:05:20 [info] 10#10: *834 client closed connection while SSL handshaking, client: 10.240.255.56, server: 0.0.0.0:443
2020/04/28 18:05:26 [info] 10#10: *835 client closed connection while SSL handshaking, client: 10.240.255.55, server: 0.0.0.0:443
2020/04/28 18:05:26 [info] 10#10: *836 client closed connection while waiting for request, client: 10.240.255.55, server: 0.0.0.0:80
2020/04/28 18:05:26 [info] 10#10: *837 client closed connection while waiting for request, client: 10.240.255.56, server: 0.0.0.0:80
2020/04/28 18:05:26 [info] 10#10: *838 client closed connection while SSL handshaking, client: 10.240.255.56, server: 0.0.0.0:443