This hacky configuration is not right. You should always use a unix socket as its more secure and performant. This is setup assuming that there is a server listening on port 3000
RAILS_ENV=production rails db:create
RAILS_ENV=production rails db:migrate
RAILS_ENV=production rails assets:precompile
RAILS_ENV=production rails s
upstream app {
# a unix socket is defined here but its actually using proxy_pass http://127.0.0.1:3000; where there is a server listening on port 3000
server unix:/home/ubuntu/object-detectr/potash/shared/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /home/ubuntu/object-detectr/potash/public;
try_files $uri/index.html $uri @app;
location @app {
proxy_pass http://127.0.0.1:3000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}