server { listen 127.0.0.1:8445 ssl; server_name jiu.51yanmei.com; ssl_certificate /etc/letsencrypt/live/jiu.51yanmei.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/jiu.51yanmei.com/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers HIGH:!aNULL:!MD5; # 商品图片静态文件 location ^~ /images/ { alias /opt/jiu/images/; expires 30d; add_header Cache-Control "public, immutable"; } # API 反向代理 location ~ ^/(api|health|version) { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_read_timeout 30s; } # Flutter 管理端(/app/ 子路径) location /app/ { alias /opt/jiu/web/; index index.html; try_files $uri $uri/ /app/index.html; } # Flutter 公开商品扫码页(/product/:id → Flutter app) location /product/ { alias /opt/jiu/web/; try_files $uri /app/index.html; } # 营销站点 — 精确路径 location = / { root /opt/jiu/marketing; try_files /index.html =404; } location ~ ^/(docs|download)(\.html)?$ { root /opt/jiu/marketing; try_files /$1.html =404; } location /features/ { root /opt/jiu/marketing; try_files $uri $uri.html =404; } # 营销站点 — 扫码 HTML 页(保留旧链接兼容) location /scan/ { root /opt/jiu/marketing; try_files /scan.html =404; } # 营销静态资源(CSS / SVG / 图片等) location /assets/ { root /opt/jiu/marketing; expires 7d; add_header Cache-Control "public"; } } server { listen 80; server_name jiu.51yanmei.com; return 301 https://$host$request_uri; }