Nginx reverse proxy to Unicorn - nginx configuration is incorrect?

I followed this tutorial to configure my rails app to run Unicorn, and be reversed proxy by Nginx on my AWS ubuntu instance.

I am able to access the nginx, "Welcome to nginx!" default page, running on the site from the outside(security is configured properly). But it is not serving the rails app.

My unicorn is running under /home/ubuntu/appname/shared/sockets/unicorn.sock=

I ran sudo service unicorn restart just in case. when i run sudo service --status-all it returns: [ ? ] unicorn_gpei-tk

As I mentioned nginx is definitely running, here is the config located in /etc/nginx/sites-available/default:

upstream app {     # Path to Unicorn SOCK file, as defined previously     server unix:/home/ubuntu/appname/shared/sockets/unicorn.sock fail_timeout=0; }  server {     listen 80;     server_name localhost;      root /home/ubuntu/appname/public;      try_files $uri/index.html $uri @app;      location @app {         proxy_pass http://app;         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; } 

symlink in /etc/nginx/sites-enabled is default -> /etc/nginx/sites-available/default -- I guess second question would be: is the sites-enabled necessary? The tutorial does not mention/require it, I came across this after the 1000 other resources I am attempting to decipher this issue.

Other info: if I run Unicorn as a user I am able to connect to it on port 8080, so Unicorn does run on it's own as well and serve the site.

And I've also restarted nginx service a few times as well, still does not update the config, probably because I have it wrong somewhere.

Really am not seeing what I am missing, any clues/ideas? thanks.


Category: ruby on rails Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.202 (s). 12 q(s)