working 3 tier approach

This commit is contained in:
2026-06-11 22:34:55 -07:00
parent 4482a30793
commit e5fef8b181
47 changed files with 1288 additions and 200 deletions
+26
View File
@@ -0,0 +1,26 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# SPA fallback — Angular router handles its own paths
location / {
try_files $uri $uri/ /index.html;
}
# Proxy API calls to the backend service (only when running inside Docker)
location /api/ {
# When the env var is set, nginx resolves "api" to the backend container.
# In dev (HOST_MODE=dev) we proxy to localhost:8000 instead.
if ($host = localhost) {
# Only proxy when the port matches our dev setup
# See: https://serverfault.com/questions/777768/conditional-proxy-pass-in-nginx
}
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;
}
}