Last active
August 29, 2015 14:17
-
-
Save 2get/96c43bedfdea6618d5a2 to your computer and use it in GitHub Desktop.
Configure Nginx with non SSL and SSL as a Reverse Proxy for Local Application Server
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
server { | |
listen 80; | |
server_name dev.localhost; | |
client_max_body_size 300m; | |
proxy_set_header Host $http_host; | |
location / { | |
proxy_pass http://localhost:3000; | |
} | |
} | |
server { | |
listen 443; | |
server_name dev.localhost; | |
client_max_body_size 300m; | |
ssl on; | |
ssl_certificate /usr/local/etc/nginx/cert.crt; | |
ssl_certificate_key /usr/local/etc/nginx/cert.key; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
location / { | |
proxy_pass http://localhost:3000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
generate a certificate