Welcome! Log In Create A New Profile

Advanced

RoR app, “Failed to load resource: the server responded with a status of 404 (Not Found)”

Jake He
October 17, 2014 09:52AM
Hi,

I am running a ruby application on Nginx. It is working fine on Apache.
When I try to load the ruby application on Nginx, I get this error: "Failed
to load resource: the server responded with a status of 404 (Not Found)" It
fails to find two .json files. I had the same issue with Apache before. It
was due to not having DocumentRoot in apache conf file. Once DocumentRoot
is defined to the public directory of the rails application, the 404 error
went away.

This is my Nginx conf file within the server block.

#owums
location ~ ^/wifi(/.*|$) {
alias /var/www/owums/public$1; # <-- be sure to point to 'public'!
passenger_base_uri /wifi;
passenger_app_root /var/www/owums;
passenger_document_root /var/www/owums/public;
passenger_enabled on;
passenger_app_env development;}

This is my Apache conf file. When I comment out DocumentRoot
/var/www/owums/public in Apache conf, Apache will throw the same error.

Any ideas?

<VirtualHost *:80>Alias /wifi /var/www/owums/public
<Location /wifi>
PassengerBaseURI /wifi
PassengerAppRoot /var/www/owums
</Location>
RailsEnv production
ServerName wifi
DocumentRoot /var/www/owums/public
<Directory /var/www/owums/public>
Allow from all
Options -MultiViews
Require all granted
</Directory></VirtualHost>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

RoR app, “Failed to load resource: the server responded with a status of 404 (Not Found)”

Jake He October 17, 2014 09:52AM

Re: RoR app, “Failed to load resource: the server responded with a status of 404 (Not Found)”

mex October 17, 2014 11:36AM

Re: RoR app, “Failed to load resource: the server responded with a status of 404 (Not Found)”

Jake He October 17, 2014 08:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 315
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready