Node.js 我的代理服务器配置是否错误?
我偶然发现了一种通过反复试验就能工作的配置。但我不知道我是否在做坏事。 我使用本指南设置了一些文件和文件夹,但随后对其进行了修改,使其适用于节点和端口3000 这是我在/home/ubuntu/server文件夹中的index.js文件Node.js 我的代理服务器配置是否错误?,node.js,nginx,amazon-ec2,Node.js,Nginx,Amazon Ec2,我偶然发现了一种通过反复试验就能工作的配置。但我不知道我是否在做坏事。 我使用本指南设置了一些文件和文件夹,但随后对其进行了修改,使其适用于节点和端口3000 这是我在/home/ubuntu/server文件夹中的index.js文件 var http=require('http'); var server=http.createServer(function(req,res){ res.end('tudor'); }); server.on('listening',functio
var http=require('http');
var server=http.createServer(function(req,res){
res.end('tudor');
});
server.on('listening',function(){
console.log('ok, server is running');
});
server.listen(3000);
index.js (END)
/etc/nginx/conf.d$less server1.conf
server {
root /home/ubuntu/public_html;
location /application1 {
proxy_pass http://localhost:8080/sampleApp;
}
location /images {
root /home/ubuntu/data;
}
location / {
proxy_pass http://localhost:3000;
}
}
这有什么问题吗?语句
root/home/ubuntu/public\uhtml代码>似乎没有目的。是的,但这也不是什么问题。我使用它是因为它是旧教程的一部分。我更担心的是直接暴露80端口,或者类似于我不太了解的东西。