0
我已经安装的Nginx在我的Ubuntu EC2实例和IM建设如何使用Node.js应用程序,当我去我的亚马逊网址即与nginx获取500内部服务器错误?
http://elastic.ip.address
它工作得很好,所以它的运行/文件:
app.get('/', function(req, res) {
return res.render('home');
});
然而,当我尝试去http://elastic.ip.address/page2:
app.get('/page2', function(req, res) {
return res.render('page2');
});
我得到了500内部服务器错误,所以我真的不知道发生了什么,这个作品在我的本地主机上没有运行nginx,但不是我的ec2。
这是我的nginx的配置文件的布局:
server {
listen 80;
root /home/ubuntu/project/;
server_name static_ip.compute-1.amazonaws.com;
location/{
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
proxy_pass http://127.0.0.1:8124/;
}
我认为这是试图调用从Nginx的配置另一个位置,否则Intially叫http://127.0.0.1:8124/,当您尝试访问http://elastic.ip.address/page2它调用http://127.0.0.1:8124//page2“//”是唯一的错误。如果你觉得自己很傻,可能会很无聊 –