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