49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
server {
|
|
listen 80 ;
|
|
listen [::]:80;
|
|
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
ssl_certificate /etc/nginx/cert/doc.crt;
|
|
ssl_certificate_key /etc/nginx/cert/doc.key;
|
|
|
|
root /var/www/html;
|
|
client_max_body_size 50M;
|
|
|
|
index index.html index.htm index.nginx-debian.html;
|
|
|
|
server_name doc.zeekling.cn;
|
|
|
|
if ( $scheme = http ){
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
location / {
|
|
add_header Strict-Transport-Security "max-age=31536000";
|
|
proxy_pass http://127.0.0.1:8181;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
}
|
|
|
|
location ~ .(jpg|png|gif|css|js|pdf|scss|ico|jpeg|bmp|flv|mp4|mp3|swf|wma|wmv|asf|mmf|zip|rar|gz|woff2|woff|ttf)$ {
|
|
proxy_pass http://127.0.0.1:8181;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_cache cache_one;
|
|
proxy_cache_valid 200 302 30d;
|
|
proxy_cache_valid 301 30d;
|
|
proxy_cache_valid any 30d;
|
|
expires 30d;
|
|
proxy_redirect off;
|
|
add_header wall "Stay simple, stay naive.";
|
|
}
|
|
|
|
location /ads.txt {
|
|
autoindex on;
|
|
}
|
|
}
|
|
|