对http://mysite.io:5003/GetProjects的POST请求,工作正常(http)。但是对https://mysite.io:5003/GetProjects的POST请求在我的网站http://mysite.io/Projects上返回Postman中的“无法获得任何响应”和“ERR_CONNECTION_REFUSED”。我正在使用PM2来运行我的backend.js,我也只是运行节点backend.js来调试。操作系统是EC2实例中的Ubuntu 16.04,其端口443处于打开状态。
nginx配置是:
server {
listen 443 ssl;
server_name mysite.io www.mysite.io;
root /var/www/html/mysite-service/build;
location / {
proxy_set_header X-Forwarded-Proto $scheme;
try_files $uri /index.html;
}
ssl_certificate /etc/letsencrypt/live/mysite.io/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mysite.io/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}