Last active
January 26, 2018 19:20
-
-
Save babadee08/a2f08541f1b3a993a9b12eb7b85c7c58 to your computer and use it in GitHub Desktop.
The finale configuration of your nginx config file
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
#HTTP CONFIG START | |
server { | |
listen 80; | |
server_name domainname.com; | |
if ($scheme = 'http') { | |
rewrite ^ https://$http_host$request_uri? permanent; | |
} | |
} | |
server { | |
listen 443 ssl; | |
server_name domainname.com; | |
ssl_certificate /etc/letsencrypt/live/domainname.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/domainname.com/privkey.pem; | |
location / { | |
proxy_pass http://localhost:3333; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment