Skip to content

Instantly share code, notes, and snippets.

@Turupawn
Created June 6, 2020 21:07
Show Gist options
  • Save Turupawn/e37090771a6f17c6a9487003c19e26f4 to your computer and use it in GitHub Desktop.
Save Turupawn/e37090771a6f17c6a9487003c19e26f4 to your computer and use it in GitHub Desktop.
upstream thin {
server 127.0.0.1:3000;
}
server {
server_name balancer.todolegal.app;
listen 80;
listen [::]:80;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
location / {
proxy_pass http://thin;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
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