accounts/deploy/openresty/cn-artifact.svc.plus.conf

47 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
listen 443 ssl;
server_name artifact.svc.plus cn-artifact.svc.plus;
ssl_certificate /etc/ssl/svc.plus.pem;
ssl_certificate_key /etc/ssl/svc.plus.rsa.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
root /data/update-server;
index index.html;
# 建议:放行 ACME/健康检查等(避免被 dotfile 规则误伤)
location ^~ /.well-known/ { allow all; }
# 目录浏览(打开 autoindex—可列出整个 /data/update-server
location / {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
add_header Accept-Ranges bytes;
try_files $uri $uri/ =404; # 保持原有 404 语义
}
# 常见安装包直下读文件(大小写不敏感)
# 这里无需 try_files命中即直接读文件减少一次磁盘判断
location ~* \.(?:dmg|zip|tar\.gz|deb|rpm|exe|pkg|appimage|apk|ipa)$ {
expires 7d;
access_log off;
add_header Cache-Control "public";
add_header Accept-Ranges bytes;
}
# 隐藏 dotfiles但不拦 /.well-known/,已在上面放行)
location ~ /\.(?!well-known/)[^/]+ {
deny all;
}
}
server {
listen 80;
server_name artifact.svc.plus cn-artifact.svc.plus;
return 301 https://$host$request_uri;
}