33 lines
972 B
Plaintext
33 lines
972 B
Plaintext
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
resolver 127.0.0.11 ipv6=off;
|
|
|
|
location = /healthz {
|
|
access_log off;
|
|
add_header Content-Type text/plain;
|
|
return 200 "ok\n";
|
|
}
|
|
|
|
location /api/ {
|
|
# Use a globally-unique hostname across attached Docker networks.
|
|
# `client` is connected to both `toir-light` and external `proxy` networks,
|
|
# so a generic name like `server` can resolve to multiple containers and
|
|
# cause intermittent routing (200/404 flapping).
|
|
set $backend http://toir-light-server:3000;
|
|
proxy_pass $backend;
|
|
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 X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|