# HTTPS 服务器配置(使用域名) server { listen 443 ssl http2; server_name aiorz.com www.aiorz.com; # SSL 证书配置(Let's Encrypt) ssl_certificate /etc/letsencrypt/live/aiorz.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/aiorz.com/privkey.pem; # SSL 优化配置 ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; root /usr/share/nginx/aiorz-webar/; index index.html; gzip on; gzip_vary on; gzip_min_length 1024; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/javascript application/json; location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public, immutable"; } location / { try_files $uri $uri/ /index.html; } add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; access_log /var/log/nginx/aiorz-webar-access.log; error_log /var/log/nginx/aiorz-webar-error.log; } # HTTP 重定向到 HTTPS server { listen 80; server_name aiorz.com www.aiorz.com; return 301 https://$server_name$request_uri; }