Created
June 13, 2017 17:33
-
-
Save skoch/6cf359f6c3dd0e663357e5f7bde008b0 to your computer and use it in GitHub Desktop.
Nginx Server Setup (SSL)
This file contains hidden or 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 default_server; | |
listen [::]:80 default_server; | |
server_name example.com www.example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
# listen 80; | |
# server_name example.com; | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; | |
include snippets/ssl-example.com.conf; | |
include snippets/ssl-params.conf; | |
location / { | |
proxy_pass http://localhost:9999; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} | |
location ~ /.well-known { | |
allow all; | |
root /usr/share/nginx/html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment