Mount nginx template with NGINX_LOCAL_RESOLVERS and require web→gateway health in deploy checks. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.0 KiB
Nginx Configuration File
37 lines
1.0 KiB
Nginx Configuration File
# Dockerfile / 非 compose 场景:静态 upstream(启动时须能解析 gateway)。
|
||
# compose 生产请用 nginx.conf.template + NGINX_ENTRYPOINT_LOCAL_RESOLVERS。
|
||
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;
|
||
}
|
||
}
|