Files
ai_site/web/nginx.conf
whm e571e98387 feat: Z34b restore-by-host + harden web nginx DNS race
Add HMAC restore-by-host for phone-less rebind; resolve gateway at request time and recreate web after stack up.

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

42 lines
1.2 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.
# Podman/Docker静态 proxy_pass 会在启动时解析 upstreamgateway 尚未进 DNS 时会 emerg 退出。
# 变量 + resolver 改为请求时解析127.0.0.11=Docker 内置 DNS10.89.0.1=常见 Podman aardvark。
resolver 127.0.0.11 10.89.0.1 valid=10s ipv6=off;
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location /api/ {
set $gw_upstream gateway:8180;
proxy_pass http://$gw_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 Authorization $http_authorization;
client_max_body_size 64m;
}
location /ai/ {
set $gw_upstream gateway:8180;
proxy_pass http://$gw_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Authorization $http_authorization;
client_max_body_size 64m;
}
location /gateway/ {
set $gw_upstream gateway:8180;
proxy_pass http://$gw_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
}
location / {
try_files $uri $uri/ /index.html;
}
}