0
votes

i have deployed a rails app. I am using nginx, passenger, and RoR 4.2.10.

I am starting the rails app with rvmsudo rails s -p80. WebBrick loads from the cl, but when I try to access the site, the 'Welcome to Nginx' page renders.

geofly.conf

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;
        server_name geofly.me www.geofly.me;

        include /etc/nginx/snippets/letsencrypt.conf;
                passenger_enabled on;
        rails_env    production;
        #root         /home/deploy/geofly/current/public;
        passenger_app_root ~/geofly/releases/20180228153842;
        #root /var/www/geofly;
        index index.html;
        location / {
                try_files $uri $uri/ =404;
        }
}

error message:

Started GET "/" for 37.151.76.85 at 2018-02-28 20:21:26 +0000

Processing by WelcomeController#index as HTML

  Rendered shared/_login.html.erb (2.0ms)

  Rendered welcome/index.html.erb within layouts/application (14.2ms)

Completed 200 OK in 136ms (Views: 135.2ms | ActiveRecord: 0.0ms)

[2018-02-28 20:21:26] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:13 

    /home/deploy/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/webrick/httpserver.rb:82:in `eof?'

    /home/deploy/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/webrick/httpserver.rb:82:in `run'

    /home/deploy/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/webrick/server.rb:307:in `block in start_thread'

passenger error

/home/deploy/geofly/shared/log/public/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: _, request: "HEAD / HTTP/1.1", host: "0.0.0.0"

update:I changed the nginx conf file.

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;
        server_name geofly.me www.geofly.me;

        include /etc/nginx/snippets/letsencrypt.conf;
                passenger_enabled on;
        rails_env    production;
        root         /var/www/geofly/releases/;
        passenger_app_root ~/geofly/releases/20180301153033;
# redirect server error pages to the static page /50x.html
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   html;
  }         }
}

Now, Puma starts, but the site will not connect. When I have nginx running, I get an port already in use error. Should nginx be running when I start the server?

1
Uncomment #root /home/deploy/geofly/current/public; and restart nginx. - Hardik Upadhyay
I updated the post. From the Capistrano deploy, ther are no files at curent/public. the app is in releases. - uberdave

1 Answers

0
votes

Reconfigured and reinstalled passenger. The issue was in passenger root.