server { listen 80; server_name hifastapp.com www.hifastapp.com www.hifastvpn.com hifastvpn.com hifast.biz www.hifast.biz; location ^~ /.well-known/acme-challenge/ { root /etc/letsencrypt; } # 统一 HTTP 转 HTTPS return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name hifastvpn.com www.hifastvpn.com; ssl_certificate /etc/letsencrypt/live/hifastvpn.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/hifastvpn.com/privkey.pem; # managed by Certbot # 安全头 add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; root /var/www/down; index index.html index.htm; location /api/ { proxy_pass https://api.hifast.biz/; proxy_set_header Host api.hifast.biz; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location ^~ /.well-known/acme-challenge/ { root /etc/letsencrypt; } location / { try_files $uri $uri/ /index.html; } location /download/ { autoindex_exact_size off; autoindex_localtime on; } } server { listen 443 ssl http2; server_name hifastapp.com www.hifastapp.com; # 使用 -0001 的新证书(通常包含 www) ssl_certificate /etc/letsencrypt/live/hifastapp.com-0001/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/hifastapp.com-0001/privkey.pem; # managed by Certbot # 安全头 add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; root /var/www/down; index index.html index.htm; location /api/ { proxy_pass https://api.hifast.biz/; proxy_set_header Host api.hifast.biz; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location ^~ /.well-known/acme-challenge/ { root /etc/letsencrypt; } location / { try_files $uri $uri/ /index.html; } location /download/ { autoindex_exact_size off; autoindex_localtime on; } } server { listen 443 ssl http2; server_name hifast.biz www.hifast.biz; ssl_certificate /etc/letsencrypt/live/hifast.biz/hifast.biz.cer; ssl_certificate_key /etc/letsencrypt/live/hifast.biz/hifast.biz.key; root /var/www/lp; index index.html index.htm; location ^~ /.well-known/acme-challenge/ { root /etc/letsencrypt; } location / { try_files $uri $uri/ /index.html; } }