Rails, NGINX does not load deployed application
<p>I have installed last stable version of NGINX (1.10)</p>

<p>In my Rails project I have created <code>nginx.conf</code> file:</p>

<pre><code>upstream puma_myapp {
  server unix:///var/www/myapp/shared/tmp/sockets/myapp.sock;
}

server {
  listen 80 default_server deferred;
  # server_name example.com;

  root /var/www/myapp/current/public;
  access_log /var/www/myapp/current/log/nginx.access.log;
  error_log /var/www/myapp/current/log/nginx.error.log info;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @puma;
  location @puma {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    proxy_pass http://puma_myapp;
  }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 10M;
  keepalive_timeout 10;
}
</code></pre>

<p>I have deploy my rails application via capistrano. It deamonized my application.</p>

<p>Now in <code>/etc/nginx</code> there is no <code>sites-enabled</code> folder. I have created this folder then I have written this:</p>

<pre><code>sudo ln -nfs "/var/www/myapp/current/config/nginx.conf" "/etc/nginx/sites-enabled/myapp"
</code></pre>

<p>Then I restart my nginx:</p>

<pre><code>sudo service nginx restart
</code></pre>

<p>When I open my page address, I still get nginx's default page, why this is happening?</p>

<p>My <code>puma.rb</code> file is:</p>

<pre><code>#!/usr/bin/env puma

directory '/var/www/myapp/current'
rackup "/var/www/myapp/current/config.ru"
environment 'production'

pidfile "/var/www/myapp/shared/tmp/pids/puma.pid"
state_path "/var/www/myapp/shared/tmp/pids/puma.state"
stdout_redirect '/var/www/myapp/current/log/puma.error.log', '/var/www/myapp/current/log/puma.access.log', true



threads 4,16

bind 'unix:///var/www/myapp/shared/tmp/sockets/myapp.sock

workers 0
</code></pre>

<p>My <code>var/log/nginx/error.log</code> file shows this:</p>

<pre><code>2016/08/16 10:07:01 [error] 10157#10157: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 178.88.194.6, server: localhost, $
2016/08/16 10:14:49 [error] 10157#10157: *3 open() "/usr/share/nginx/html/phpMyAdmin/scripts/setup.php" failed (2: No such file or directory), client: 203.110.167.86, $
2016/08/16 10:14:55 [error] 10157#10157: *4 open() "/usr/share/nginx/html/pma/scripts/setup.php" failed (2: No such file or directory), client: 203.110.167.86, server:$
2016/08/16 10:15:00 [error] 10157#10157: *5 open() "/usr/share/nginx/html/myadmin/scripts/setup.php" failed (2: No such file or directory), client: 203.110.167.86, ser$
2016/08/16 10:36:20 [error] 26599#26599: *1 open() "/usr/share/nginx/html/admin" failed (2: No such file or directory), client: 178.88.194.6, server: localhost, reques$
2016/08/16 10:42:11 [error] 27962#27962: *1 open() "/usr/share/nginx/html/admin" failed (2: No such file or directory), client: 178.88.194.6, server: localhost, reques$
</code></pre>