2026-06-15 13:18:43 +08:00
|
|
|
|
# 业务员端 - ddy.gaowenbu.cn(HTTP 版,申请 SSL 后再改 HTTPS)
|
|
|
|
|
|
server {
|
|
|
|
|
|
listen 80;
|
|
|
|
|
|
server_name ddy.gaowenbu.cn;
|
|
|
|
|
|
|
|
|
|
|
|
# ---------- 日志 ----------
|
|
|
|
|
|
access_log /www/wwwlogs/ddy.gaowenbu.cn.log;
|
|
|
|
|
|
error_log /www/wwwlogs/ddy.gaowenbu.cn.error.log;
|
|
|
|
|
|
|
|
|
|
|
|
# ---------- 前端静态文件(业务员端) ----------
|
|
|
|
|
|
root /www/wwwroot/ddy.gaowenbu.cn;
|
|
|
|
|
|
index index.html;
|
|
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 静态资源缓存
|
|
|
|
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|eot)$ {
|
|
|
|
|
|
expires 30d;
|
|
|
|
|
|
add_header Cache-Control "public, immutable";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# ---------- 后端 API 反向代理 ----------
|
|
|
|
|
|
location /api/ {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:8000;
|
|
|
|
|
|
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;
|
|
|
|
|
|
client_max_body_size 20m;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-15 14:24:25 +08:00
|
|
|
|
# ---------- WebSocket 反向代理 ----------
|
|
|
|
|
|
location /ws/ {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:8000;
|
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
|
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_read_timeout 86400s;
|
|
|
|
|
|
proxy_send_timeout 86400s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-06-15 13:18:43 +08:00
|
|
|
|
location = /health {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:8000;
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
location /uploads/ {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:8000;
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Let's Encrypt 文件验证
|
|
|
|
|
|
location ~ /\.well-known {
|
|
|
|
|
|
allow all;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 禁止访问其他隐藏文件
|
|
|
|
|
|
location ~ /\. {
|
|
|
|
|
|
deny all;
|
|
|
|
|
|
access_log off;
|
|
|
|
|
|
log_not_found off;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|