【发布时间】:2016-06-23 03:31:37
【问题描述】:
我编写了一个基于sailsjs 的应用程序,部署在我的一个VPS 中。应用程序正在使用 pm2 以生产模式运行。我可以通过public_ip:1338访问,一切正常。
所以安装了 nginx,配置了 proxy_pass,安装了letsencrypt ssl。当我尝试访问域时,我看到的是使用 SSL 的 Nginx 默认页面,而不是 NodeJS (SailsJS) 应用程序。
这里是 nginx 配置文件
server {
listen 80;
server_name domain.net www.domain.net;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
ssl_certificate /etc/letsencrypt/live/domain.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.net/privkey.pem;
server_name domain.net;
location / {
proxy_pass http://localhost:1338;
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;
}
}
我需要解决这个问题。你们能指导我解决这个问题吗?
【问题讨论】:
-
我不认为它是重复的,因为我读过它,尝试过但失败了。我没有问现在是什么?,我提到了我想要什么和我尝试了什么。
-
你是否在 nginx.conf 文件中包含
include /etc/nginx/sites-enabled/*;? -
我已经把conf文件放到了/etc/nginx/conf.d目录下。