Eu também enfrentei o mesmo problema. Eu configurei o arquivo em sites habilitados. A configuração do arquivo é fornecida abaixo.
backend upstream {
servidor localhost: 3000;
}
estamos no contexto http aqui
mapear $ http_upgrade $ connection_upgrade {
# atualização padrão;
# '' fechar;
}
servidor {
escute 81 default_server;
# listen [::]: 81 default_server;
listen 80;
server_name track.xxxxxxxxxx.com;
server_tokens off;
return 301 https://$host$request_uri;
}
a instância segura do servidor nginx
servidor {
# listen 443 ssl;
# ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
# ssl_certificate_key /etc/ssl/private/.domainName.1.key;
#server_name xyz;
# location / {
# proxy_set_header X-Real-IP $ remote_addr;
# proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
# proxy_set_header Host $ http_host;
# proxy_http_version 1.1;
# proxy_set_header Atualize $ http_upgrade;
# proxy_set_header Conexão $ connection_upgrade;
# proxy_set_header X-NginX-Proxy true;
# proxy_set_header X-Ssl on;
# proxy_pass link ;
# proxy_redirect off;
#}
}
a instância segura do servidor nginx
servidor {
listen 443 ssl;
ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
ssl_certificate_key / etc / ssl / private / .domain.1.key;
escute 80 default_server;
server_name track.xxxxxxxxxx.com;
server_name _;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Ssl on;
proxy_pass http://localhost:3000;
proxy_redirect off;
}
}
servidor {
escute 7003;
server_name localhost;
root / opt / ClientFolder /;
location / {
try_files $ uri @backend;
}
location @backend {
proxy_pass https://backend;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Following is necessary for Websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Por favor, faça necessário.