Search code examples
ruby-on-railsubuntunginxpassenger

Nginx can't find user directory


i'm having trouble configure my server on nginx, i'm tryng to deploy a RoR applicaion with passenger when i try to start nginx i recive this error:

Starting nginx: nginx: [emerg] unknown directive "icaro" in /opt/nginx/conf/nginx.conf:125

here is my server configuration on the nginx.conf

server { 
    listen 80;
    server_name xx.xx.xx.xx;
    passenger_enabled on;
    location / {
        icaro /icarodroplet/public;
    }
}

if i change the icaro (my deployment user) to root i won't recive this error, but server cant find my application directory.

what i'm doing wrong? this give me headches D:

thanks


Solution

  • I don't think root means the root user here. It means the root directory for the project. You can change the user at the top of the conf file. There might be something like user nobody; Change it to your user. Here is a good link to follow.

    server { 
      listen 80;
      server_name xx.xx.xx.xx;
      passenger_enabled on;
      location / {
        root /icarodroplet/public;
      }
    }