我已将我的应用部署到ununtu。
这是bin / www:
app.set('port', 3000);
app.set('host','app.site.com');
var server = http.createServer(app);
server.listen(port,'64.143.255.122');//I put here a fake IP (deployed with the real one)
server.on('error', onError);
server.on('listening', onListening);
我在自己的电脑上创建了一个主机:64.143.255.122 app.site.com
我打开浏览器:http://app.site.com:3000
但它不起作用。
但是,如果我通过lynx
,在服务器内部,并写lynx http://localhost:3000
它将起作用,我会得到正确的页面。
可能是什么问题?
由于
答案 0 :(得分:1)
你是否让iptables允许它?
试试这个:
iptables -A INPUT -p tcp --dport 3000 -j ACCEPT