30 lines
750 B
Nginx Configuration File
30 lines
750 B
Nginx Configuration File
# Only describe the http server, certbot will install https for us
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name $DOMAIN;
|
|
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
|
|
server_name $DOMAIN;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem;
|
|
|
|
location / {
|
|
proxy_pass http://localhost:$PORT;
|
|
proxy_http_version 1.1;
|
|
|
|
# Websocket support
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
}
|
|
}
|