<div dir="ltr">Hi,<div><br></div><div><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">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.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">This is my Nginx conf file within the server block.</p><pre class="" style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.804800033569336px"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,128,128)">#owums</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
location </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">~</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">^</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">/wifi(/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">.*|</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">$</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">)</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">{</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">alias</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">var</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">www</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">owums</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">public$1</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,128,128)"># <-- be sure to point to 'public'!</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
passenger_base_uri </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">wifi</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
passenger_app_root </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">var</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">www</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">owums</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
passenger_document_root </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">var</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">www</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">owums</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">public</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
passenger_enabled on</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
passenger_app_env development</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">}</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">This is my Apache conf file. When I comment out DocumentRoot /var/www/owums/public in Apache conf, Apache will throw the same error. </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">Any ideas? </p><pre class="" style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.804800033569336px"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"><</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">VirtualHost</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">*:</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">80</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">></span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Alias</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">wifi </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">var</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">www</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">owums</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">public
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"><</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Location</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">wifi</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">></span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">PassengerBaseURI</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">wifi
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">PassengerAppRoot</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">var</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">www</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">owums
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"></</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Location</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">></span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">RailsEnv</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> production
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">ServerName</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> wifi
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">DocumentRoot</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">var</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">www</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">owums</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">public
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"><</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Directory</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">var</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">www</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">owums</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">public</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">></span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Allow</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> from all
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Options</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">-</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">MultiViews</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Require</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> all granted
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"></</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">Directory</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">></span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"></</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(43,145,175)">VirtualHost</span><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">></span></code></pre></div></div>