My site static files are not served (node app on Amazon AWS)

I installed a simple node.js / express website using the instructions on this page: http://techprd.com/setup-node-js-web-server-on-amazon-ec2/

It seems like that everything is working well when i specify the port number (5000), as you can see in the following: http://aws.deliverightlogistics.com:5000/

however, when you remove the port number, all the static files cannot be found and you can see the result here: http://aws.deliverightlogistics.com/

The node/express page saving looks like this:

app.get('/images/*', function(req,res) { var url = __dirname + '/public' + req.url; res.sendfile(url); });

app.get('/', function(req,res) { var home = __dirname + '/public/index.html'; res.sendfile(home); }); Is there anything i'm missing here?

Thx


add the following configuration so that Nginx acting as a proxy redirect to port 3000 traffic from the server when we come from “subdomain.your_domain.com"

See the original post:

Node.js + Nginx - What now?

链接地址: http://www.djcxy.com/p/52616.html

上一篇: 使用express.static后,里面的代码不会运行

下一篇: 我的站点静态文件未提供(Amazon AWS上的节点应用程序)