27 lines
696 B
Nginx Configuration File
27 lines
696 B
Nginx Configuration File
events {}
|
|
|
|
http {
|
|
server {
|
|
listen 80;
|
|
|
|
# Optional: basic sanity endpoint at /
|
|
location / {
|
|
default_type text/plain;
|
|
return 200 "nginx ok\n";
|
|
}
|
|
|
|
# Proxy all /api/* to the FastAPI service (service name DNS)
|
|
location /api/ {
|
|
proxy_pass http://api:8000;
|
|
|
|
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;
|
|
|
|
# Keep typical proxy defaults sane
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
}
|
|
}
|
|
} |