Files
kefu/deploy/im-admin/im.zhenyangtang.cn.conf
T
2026-09-21 10:34:06 +08:00

68 lines
2.3 KiB
Plaintext
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 im.zhenyangtang.cn;
root /www/dk_project/wwwroot/im.zhenyangtang.cn;
client_max_body_size 100m;
location ^~ /.well-known/acme-challenge/ {
try_files $uri =404;
}
# 桌面端和直接调用方使用后端原生的 /api/v2/* 地址。
location ^~ /api/v2/ {
proxy_pass http://127.0.0.1:18766;
proxy_http_version 1.1;
proxy_set_header Host $http_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_connect_timeout 15s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
}
# Vite 开发环境原本会把前端的 /api/* 重写成 /api/v2/*;
# 生产环境由 Nginx 完成相同转换。
location ^~ /api/ {
proxy_pass http://127.0.0.1:18766/api/v2/;
proxy_http_version 1.1;
proxy_set_header Host $http_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_connect_timeout 15s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
}
location ^~ /gateway/ {
proxy_pass http://127.0.0.1:18770/;
proxy_http_version 1.1;
proxy_set_header Host $http_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_connect_timeout 15s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
}
location / {
proxy_pass http://127.0.0.1:18766;
proxy_http_version 1.1;
proxy_set_header Host $http_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 $connection_upgrade;
proxy_connect_timeout 15s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
}
access_log /www/wwwlogs/im.zhenyangtang.cn.log;
error_log /www/wwwlogs/im.zhenyangtang.cn.error.log;
}