nginx上的SSL充当节点服务器的反向代理

时间:2016-04-14 04:15:24

标签: node.js ssl nginx

我需要访问我的nodejs api,它由https上的nginx服务器反向代理。为了实现这一点,我在位置/ etc / nginx生成了一个自签名证书,然后修改了nginx配置,如下所示:

server {
    listen 443;

    server_name api.something.com;

    ssl_certificate           /etc/nginx/cert.crt;
    ssl_certificate_key       /etc/nginx/cert.key;
    ssl on;
    add_header Strict-Transport-Security max-age=500;

    location / {
        proxy_pass http://10.132.176.xx:8888; #private ip
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

现在每当我尝试访问https://api.something.com时,我总是会在Google Chrome中收到连接拒绝错误。普通的http工作正常。有线索吗?

0 个答案:

没有答案