# 东区人才卡 —— 站点(2026-09-29) # # 部署位置:/etc/nginx/sites-available/talent-card (软链到 sites-enabled/) # # 端口分工: # 8081 → **测试环境**(完整功能,用 snippets/talent-card-locations.conf) # 80 → 只做 301 跳到 https # 443 → 这个域名留给**生产环境**,目前**尚未部署**,所以只显示占位页 # # 生产上线时怎么切:把下面 443 那个 server 块里的 `root` 与两个 location 换成 # `root <生产的 dist 目录>;` + `include snippets/talent-card-locations.conf;`, # 80 的 301 不用动。占位页在 /data/talent-card/placeholder/index.html。 # # 证书:华为云 DV(TrustAsia 签发),SAN 覆盖 `dqrcfwpt.com` 与 `www.dqrcfwpt.com`。 # `/etc/nginx/ssl/talent-card/server.crt` **必须含中间链**(bundle,4451 字节)。 # **2027-02-11 到期,且不会自动续到本机** —— 到期前重新下载再传一次。 # HSTS 仍是第一步:max-age=86400,无 includeSubDomains / preload。 server { listen 8081; server_name _; include snippets/talent-card-locations.conf; } server { listen 80; server_name www.dqrcfwpt.com dqrcfwpt.com; return 301 https://$host$request_uri; } server { listen 443 ssl; http2 on; server_name www.dqrcfwpt.com dqrcfwpt.com; ssl_certificate /etc/nginx/ssl/talent-card/server.crt; ssl_certificate_key /etc/nginx/ssl/talent-card/server.key; ssl_trusted_certificate /etc/nginx/ssl/talent-card/server.crt; ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers off; ssl_session_cache shared:SSL:10m; ssl_session_timeout 1d; # stapling 需要能解析 OCSP 响应者的域名,没有 resolver 时它会静默不生效 resolver 223.5.5.5 119.29.29.29 valid=300s; ssl_stapling on; ssl_stapling_verify on; add_header Strict-Transport-Security "max-age=86400" always; root /data/talent-card/placeholder; location / { try_files $uri /index.html; } # 这个域名上还没有后端。别让 /api 落到静态页上、让人以为接口可用。 location /api/ { default_type application/json; return 503 '{"code":503,"message":"production not deployed"}'; } }