Skip to content

Instantly share code, notes, and snippets.

@skoch
Created June 13, 2017 17:33
Show Gist options
  • Save skoch/6cf359f6c3dd0e663357e5f7bde008b0 to your computer and use it in GitHub Desktop.
Save skoch/6cf359f6c3dd0e663357e5f7bde008b0 to your computer and use it in GitHub Desktop.
Nginx Server Setup (SSL)
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