Node/Express Routes Return 404

42 views
Skip to first unread message

Ronald Roe

unread,
Aug 23, 2015, 3:57:37 PM8/23/15
to phusion-...@googlegroups.com
I've been banging my head against this one for over a week now. I've also been up one side of the internet and down the other looking for answers.

My hosting company set up Passenger for me on the VPS (CentOS).

My app loads the index page, and if I pass login data, properly returns from the database. However, none of the other routes work. They all return 404 errors. Again, the index route, which is in the same folder as the others, loads without issue. The app is on a subdomain, but runs from /home/user/app.

For example, if I go to app.site.com, the page loads, but when I go to app.site.com/login, I get a 404 error.

It almost seems to me like maybe Apache is attempting to handle it rather than Passenger, but I don't even know where to begin trying to fix that. Is there a bit of configuration I'm missing?

Everything works fine locally, and on a server running only Node. 

EDIT: Models, views and public folder assets load without issue.

Daniel Knoppel

unread,
Aug 24, 2015, 10:58:15 AM8/24/15
to Phusion Passenger Discussions
Did you find our new Library of documentation in your quest?

If that doesn't help, it's best to post your (Apache/Passenger) configuration for further assistance.

- Daniel

Ronald Roe

unread,
Aug 24, 2015, 7:57:46 PM8/24/15
to phusion-...@googlegroups.com
I'm not sure that's what I'm looking for, unless I'm reading it wrong. The app loads, but only the index route, along with any assets, views and models associated. All other routes fail with a 404. 

By "configuration", I'm assuming you mean the httpd.conf, which I'm attaching. The Passenger bits and virtualhost for the app start at line 499.

Thanks.
httpd.conf

Daniel Knoppel

unread,
Aug 26, 2015, 5:07:32 AM8/26/15
to Phusion Passenger Discussions
I'm not sure what you're trying to do. The documentation link instructs:

    DocumentRoot /path-to-your-app/public
    PassengerAppRoot /path-to-your-app
    ..

    <Directory /path-to-your-app/public>
    ..
While you have two different paths, and missing public for the docroot:
    DocumentRoot /home/ron/wingman
    PassengerAppRoot /home/ron/wingman

    ..

    <Directory /var/www/myapp/code/public>

- Daniel

Ronald Roe

unread,
Aug 26, 2015, 7:24:28 AM8/26/15
to Phusion Passenger Discussions
Thank you. My host set that part up, and I didn't notice that line when I was looking through it.
Reply all
Reply to author
Forward
0 new messages