Skip to content

Instantly share code, notes, and snippets.

@h00s
Last active October 6, 2018 20:38
Show Gist options
  • Save h00s/2bf160f66ebad402af611944bf359863 to your computer and use it in GitHub Desktop.
Save h00s/2bf160f66ebad402af611944bf359863 to your computer and use it in GitHub Desktop.
Nginx conf reverse proxy for Rails 5.2.1 Puma with SSL
location @app {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_upstream;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on; # Optional
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment