c001f0e8e6
- Windows 客户端打成 jiu-windows-x64-setup.exe(Inno Setup,中文向导、 桌面/开始菜单快捷方式、卸载项),替代解压版 zip - provision-windows.sh 自动静默安装 Inno Setup(缺则装) - 下载 URL 从内网 HTTP Forgejo 改为 https://jiu.51yanmei.com/downloads/, 修复 HTTPS 页面下发 http 内网地址被浏览器拦截(无法安全下载),win/mac 均生效 - deploy.sh 将安装包发布到 EC2 /opt/jiu/downloads/,nginx 新增 /downloads/ 路由 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
82 lines
2.3 KiB
Plaintext
82 lines
2.3 KiB
Plaintext
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;
|
||
|
||
client_max_body_size 20m;
|
||
|
||
# 商品图片静态文件
|
||
location ^~ /images/ {
|
||
alias /opt/jiu/images/;
|
||
expires 30d;
|
||
add_header Cache-Control "public, immutable";
|
||
}
|
||
|
||
# 文件导入接口(超时更长)
|
||
location ~ ^/api/v1/import/ {
|
||
proxy_pass http://127.0.0.1:8080;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
|
||
# 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;
|
||
}
|
||
|
||
# index.html 不缓存,确保每次发版后浏览器加载最新版
|
||
location = /app/index.html {
|
||
alias /opt/jiu/web/index.html;
|
||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||
add_header Pragma "no-cache";
|
||
expires 0;
|
||
}
|
||
|
||
# 公开商品详情页(扫码跳转)→ 交给 Flutter Web 路由处理
|
||
location ~ ^/product/ {
|
||
root /opt/jiu/web;
|
||
try_files $uri /app/index.html;
|
||
}
|
||
|
||
# 扫码页(/scan/<id> → scan.html,JS 从 URL 读取 id)
|
||
location /scan/ {
|
||
root /opt/jiu/marketing;
|
||
try_files /scan.html =404;
|
||
}
|
||
|
||
# 桌面客户端安装包下载(Windows .exe / macOS .zip)
|
||
location /downloads/ {
|
||
alias /opt/jiu/downloads/;
|
||
add_header Content-Disposition "attachment";
|
||
add_header Cache-Control "no-cache";
|
||
autoindex off;
|
||
}
|
||
|
||
# 营销站点兜底(根路径及所有其他路径)
|
||
location / {
|
||
root /opt/jiu/marketing;
|
||
try_files $uri $uri.html $uri/index.html /index.html;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name jiu.51yanmei.com;
|
||
return 301 https://$host$request_uri;
|
||
}
|