Files
wangliang 39986f10f2 初始化 LibreDesk 本地实例部署仓库
- docker compose 部署:app / db / redis / tls(nginx) / bridge-tools,宿主端口错开避免与本机服务冲突
- bridge-tools 内联进仓库(compose build 路径改为 ./bridge-tools),仓库自包含可部署
- 部署说明 README、crm-new 对照与 bridge-tools 方案文档、备份与隧道脚本
- .gitignore 排除 .env、config.toml、uploads/、tls 私钥/证书、backups/、logs/
2026-10-29 13:24:13 +08:00

45 lines
1.5 KiB
Nginx Configuration File
Raw Permalink 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.
# LibreDesk 局域网 HTTPS 反代(9443)
# 原因:libredesk v2.9.x 的 Agent WebSocket 只接受 https 或 localhost 的 Origin,
# 用 http://<局域网IP>:9001 打开后台,WS 会被 403 拒绝,界面一直 “Connecting...”。
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/privkey.pem;
# 基础安全头(自签证书,不启用 HSTS)
ssl_protocols TLSv1.2 TLSv1.3;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
# X-Frame-Options 由应用自身设置(SAMEORIGIN),避免重复
client_max_body_size 100M;
location / {
proxy_pass http://app:9000;
proxy_http_version 1.1;
# WebSocket
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# 保留原始 Host(含 9443 端口),libredesk 的 WS Origin 校验依赖它
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
# libredesk 用 X-Client-IP 做限流/审计,必须设置
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
# 长连 WS 不要过早断开
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
}
}