nginx не распознает имя сервера в https - PullRequest
0 голосов
/ 24 марта 2019

У меня есть приложение узла на localhost: 4444, мне нужно переслать:

  1. http://chicagobusinessintelligence.com, http://www.chicagobusinessintelligence.com
  2. https://chicagobusinessintelligence.com

до https://www.chicagobusinessintelligence.com

Вот мой nginx.conf

            upstream Site {
            server 127.0.0.1:4444 max_fails=10 fail_timeout=35s;
        }

        server {
            listen 80;
            listen [::]:80;
            server_name chicagobusinessintelligence.com www.chicagobusinessintelligence.com;
            return 301 https://www.chicagobusinessintelligence.com$request_uri;
        }
        server {
            listen 443 ssl;
            listen [::]:443 ssl;
            server_name chicagobusinessintelligence.com;
            ssl on;
            ssl_certificate /etc/letsencrypt/live/chicagobusinessintelligence.com/fullchain.pem;
            ssl_certificate_key /etc/letsencrypt/live/chicagobusinessintelligence.com/privkey.pem;
            return 301 https://www.chicagobusinessintelligence.com$request_uri;
        }
        server {
            listen 443 ssl;
            server_name www.chicagobusinessintelligence.com;
            ssl on;
            ssl_certificate /etc/letsencrypt/live/www.chicagobusinessintelligence.com/fullchain.pem;
            ssl_certificate_key /etc/letsencrypt/live/www.chicagobusinessintelligence.com/privkey.pem;
            location / {
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_pass http://Site;
            }
        }

Однако https://www.chicagobusinessintelligence.com не распознается nginx ???

curl https://www.chicagobusinessintelligence.com
curl: (6) Could not resolve host: www.chicagobusinessintelligence.com

Хотя все три вышеупомянутых варианта дают: 301 Moved Permanently, что логично.

...