Files
ai_site/web/nginx.conf.template
whm d489169bec fix: host nginx proxies /api to gateway to avoid web DNS 502
Public HTTPS API/AI/gateway go to 127.0.0.1:8180; web only serves static. Restores static gateway upstream inside the web container.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 01:23:34 +08:00

38 lines
1.1 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.
# compose 生产:静态 upstream启动时解析一次
# 部署脚本在 gateway 就绪后 force-recreate web避免 DNS 竞态 emerg。
# 公网流量优先经宿主机 Nginx 直连 gateway见 nginx/aijz.host.conf不依赖本文件反代。
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://gateway:8180;
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 Authorization $http_authorization;
client_max_body_size 64m;
}
location /ai/ {
proxy_pass http://gateway:8180;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Authorization $http_authorization;
client_max_body_size 64m;
}
location /gateway/ {
proxy_pass http://gateway:8180;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
location / {
try_files $uri $uri/ /index.html;
}
}