Skip to content

Instantly share code, notes, and snippets.

@ewalk153
Created January 30, 2023 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewalk153/de9fe7a418ffe8e298ba8e4cc154701d to your computer and use it in GitHub Desktop.
Save ewalk153/de9fe7a418ffe8e298ba8e4cc154701d to your computer and use it in GitHub Desktop.
Nginx conf for reverse proxying a rails app
upstream app {
# Path to Puma SOCK file, as defined previously
# server unix:/home/deploy/appname/shared/sockets/puma.sock fail_timeout=0;
server unix:/Users/ericwalker/src/github.com/ewalk153/sample-rails-app/shared/sockets/puma.sock fail_timeout=0;
}
server {
listen 4000;
server_name localhost;
root /Users/ericwalker/src/github.com/ewalk153/sample-rails-app/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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment