2015-01-14 31 views
-3

http://www.basicspace.org:5000/#/從域AWS服務器剝離端口號

這裏是我的網址,我想只運行在http://www.basicspace.org應用程序,而不端口號。我看過很多教程,但沒有深入我的腦海,所以在這裏問一些更好的解決方案。

+0

可能重複的[如何在端口80上運行Node.js?](http://stackoverflow.com/questions/6109089/how-do-i-run-node-js-on-port -80) – tedder42

+0

你也可以反向代理,使用iptables或使用ELB。但是,如果您在單個EC2上運行節點並且這已經過時,請使用Elastic Beanstalk或Heroku。 – tedder42

回答

0

如果它只是一個運行NodeJS的單個EC2實例,那麼。如果它監聽ELB,則在ELB中配置PORT源和目的地。

var util = require('util'); 
var http = require('http'); 


http.createServer(function (request, response) { 
    response.writeHead(200, { 'Content-Type': 'text/plain' }); 
    response.write('Hello World'); 
    response.end(); 
}).listen(80); 
+0

我試圖聽80端口,但它沒有幫助 – user3840211

+0

你可以檢查 - 是PORT 80的安全組策略 - TCP打開爲0.0.0.0/0 –