32 lines
898 B
Nginx Configuration File
32 lines
898 B
Nginx Configuration File
server {
|
|
listen 8080;
|
|
server_name _;
|
|
|
|
# Docker embedded DNS, re-queried every 10s so rebuilt containers are picked up.
|
|
resolver 127.0.0.11 valid=10s;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
location /api/ {
|
|
# Resolve `api` at request time: a rebuilt api container gets a new
|
|
# IP, and a startup-time-only DNS answer would pin nginx to it (502s).
|
|
set $api_upstream http://api:8080;
|
|
proxy_pass $api_upstream;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location = /health {
|
|
set $health_upstream http://api:8080;
|
|
proxy_pass $health_upstream/health;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|