Files
chat-one-web/nginx.conf
alboped 8018438f42
All checks were successful
CI / build (push) Successful in 2m31s
feat(ui): 统一登录与会话页的 shadcn 交互组件
登录页切换为官方 input-group 组合并将全站提示从 antd message 统一为 sonner toast,确保通知位置与风格一致。同时补齐相关 shadcn CLI 生成组件及构建配置更新。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 18:33:57 +08:00

51 lines
1.4 KiB
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# 后端接口反向代理Docker 启动时由 API_UPSTREAM 注入例如http://host.docker.internal:3000
location /api/ {
proxy_pass ${API_UPSTREAM};
proxy_http_version 1.1;
proxy_set_header Host $host;
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_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
# Vite build 产物:文件名带 hash可长期缓存
location /assets/ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
# 单独图标按中等缓存(如果后续也迁到 /assets可删除
location ~* ^/(favicon\.ico|favicon\.png|apple-touch-icon\.png)$ {
expires 7d;
add_header Cache-Control "public, max-age=604800";
try_files $uri =404;
}
# 入口 HTML 每次协商缓存,确保能拿到最新资源清单
location = /index.html {
add_header Cache-Control "no-cache";
try_files $uri =404;
}
# SPA 路由回退
location / {
try_files $uri $uri/ /index.html;
}
}