2
votes

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

1
Can you add some middleware to log the requests coming into your server? Did you check the case of the file names? Did you try requesting the resources one at a time and see what happens on the server? Is it getting handled by another route handler up the stack? I think we need to see a bit more... Are both sites running the same code?akaphenom
let me know what kind of logs I should add and I'll do that...Or A
In the middleware I would log the path of the object being requested. I would also consider hard coding the complete paths to some resources and see if it is an issue with the wild carding...akaphenom

1 Answers

0
votes

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?