I have no index.html file in my public folder. My rails routes file routes this, and it works fine when I run 'rails server' on my machine.

I'm trying to deploy the app. I have passenger and nginx running When I run rails server on my local machine, it works fine. But it's just trying to access static file when I try to access it on the production server.

Here's my nginx conf:

worker_processes  1;
#pid        logs/nginx.pid;
events {
    worker_connections  1024;
http {
    passenger_root /usr/lib/ruby/gems/1.9.1/gems/passenger-3.0.2;
    passenger_ruby /usr/bin/ruby;
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  mmjconsult.com;
        root /www/mmjs/public;
        access_log  logs/host.access.log;
        passenger_enabled on;

Thank you for any help. I really appreciate it.


Have you found out what your problem was?

I actually run into the same problem, and of course it was all my fault: I'm using capistrano to deploy my app, and just forgot that it sits in the "current" directory. So instead of

root /var/www/myapp/public;

the app was actually in

root /var/www/myapp/current/public;

Hope this helps.

Rgds, Rollo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.