Skip to content

Instantly share code, notes, and snippets.

@Jeiwan
Created February 19, 2017 09:01
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 Jeiwan/ea87a056fcd2994d0bdf57c5a665f836 to your computer and use it in GitHub Desktop.
Save Jeiwan/ea87a056fcd2994d0bdf57c5a665f836 to your computer and use it in GitHub Desktop.
NGINX reverse proxy with SSL
events {
worker_connections 1024;
}
http {
server {
listen 80;
listen 443 default ssl;
server_name SERVER_NAME;
ssl_certificate /etc/nginx/SERVER_NAME.pem;
ssl_certificate_key /etc/nginx/SERVER_NAME.key;
access_log /var/log/nginx/access.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://LOCAL_SERVER:3000;
proxy_read_timeout 90;
proxy_redirect http:// https://;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment