21 lines
715 B
Nginx Configuration File
21 lines
715 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
client_max_body_size 200m;
|
|
# 地址为占位默认值(127.0.0.11=Docker 内嵌 DNS);镜像 entrypoint 启动时会按
|
|
# /etc/resolv.conf 的首个 nameserver 重写本行,兼容 podman aardvark-dns。
|
|
resolver 127.0.0.11 valid=10s;
|
|
|
|
location /api/ {
|
|
set $api_upstream http://api:8080; # 变量式 → 每次按 DNS 解析,scale 后轮询到新副本(spec §11)
|
|
proxy_pass $api_upstream; # 无 URI 部分:保留 /api 前缀转发
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
try_files $uri /index.html;
|
|
}
|
|
}
|