LINUX.ORG.RU

Не работает домен по https в nginx

 


0

1

Здравствуйте. Имеется nginx, который я вручную поставил добавляяя вручную каждый модуль. Вот так конфигурил:

./configure --with-http_ssl_module --conf-path=/etc/nginx/nginx.conf --add-module=/opt/geoip2/ngx_http_geoip2_module --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --with-debug --with-pcre-jit --with-ipv6 --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_v2_module --with-http_sub_module --with-stream --with-mail --with-threads --with-stream_ssl_module --with-mail_ssl_module

Есть два сайта в sites-enabled: api и panel. api работает по http и все норм. Но panel работает по https. Вроде как все модули подключил ssl, но всеравно не хочет заходить. Конфига panel:

server {
   listen 80;
   server_name panel.MY_DOMEN.ru;
 
   location / {
       return 301 https://$server_name$request_uri;
   }
}
 
map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
}
# HTTPS server
server {
   listen 443 ssl http2;
   server_name panel.MY_DOMEN.ru;
 
   access_log /var/log/nginx/panel.access.log;
   error_log /var/log/nginx/panel.error.log;
 
   include snippets/ssl-MY_PROJECT.conf;
   include snippets/ssl-params.conf;
 
   rewrite ^(/)$ https://$host/admin/$1 permanent;
 
   location /admin/ws {
      proxy_pass  http://localhost:9000;
 
      proxy_set_header Host $host;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_read_timeout 1000s;
 
      proxy_cache_bypass 1;
      proxy_no_cache 1;
   }
 
   # serve assets or request page from proxy (if asset not found)
   location / {
      try_files $uri @proxy;
   }
 
   # the play web server
   location @proxy {
      proxy_pass  http://localhost:9000;
      proxy_redirect off;
      proxy_buffering off;
 
      #send protocol info to play server
      proxy_set_header        Host               $host;
      proxy_set_header        X-Real-IP          $remote_addr;
      proxy_set_header        X-Forwarded-Proto  https;
      proxy_set_header        X-Forwarded-Ssl    on;
      proxy_set_header        X-Forwarded-For    $proxy_add_x_forwarded_for;
   }

До того как ставил nginx с нуля, был скачан nginx по команде sudo apt-get install nginx. После этого я удалил командой sudo apt-get purge nginx nginx-common и поставил c нуля.

Ключи в папке snippets уже были. Нужно ли генерить новые ключи после каждой инсталяции nginx? И вообще, как думаете почему я не могу зайти по домену panel.MY_DOMEN.ru? Раньше этот домен работал в прошлом nginx.



Последнее исправление: beastie (всего исправлений: 1)

Ответ на: комментарий от zolden

root@dev-MY_ADDRESS:/etc/nginx/sites-enabled# curl -v https://panel.MY_ADDRESS.ru/ * Trying 2a01:4f8:162:2249::12... * connect to 2a01:4f8:162:2249::12 port 443 failed: Connection refused * Trying 5.9.131.132... * Connected to panel.MY_ADDRESS.ru (5.9.131.132) port 443 (#0) * found 173 certificates in /etc/ssl/certs/ca-certificates.crt * found 692 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * gnutls_handshake() failed: The TLS connection was non-properly terminated. * Closing connection 0 curl: (35) gnutls_handshake() failed: The TLS connection was non-properly terminated.

stim644
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.