34 lines
909 B
Plaintext
34 lines
909 B
Plaintext
# HTTPS server
|
|
server {
|
|
listen 443 ssl;
|
|
server_name sankey.biboer.cn;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/sankey.biboer.cn/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/sankey.biboer.cn/privkey.pem; # managed by Certbot
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
|
|
root /home/gavin/sankey/dist;
|
|
index index.html;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
}
|
|
|
|
# HTTP to HTTPS redirect
|
|
server {
|
|
listen 80;
|
|
server_name sankey.biboer.cn;
|
|
|
|
if ($host = sankey.biboer.cn) {
|
|
return 301 https://$host$request_uri;
|
|
} # managed by Certbot
|
|
|
|
return 404;
|
|
} |