Created
February 19, 2017 09:01
-
-
Save Jeiwan/ea87a056fcd2994d0bdf57c5a665f836 to your computer and use it in GitHub Desktop.
NGINX reverse proxy with SSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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