Files
thoughts/nginx/nginx.conf
Gabriel Kaszewski 247c6ad955
All checks were successful
Build and Deploy Thoughts / build-and-deploy-local (push) Successful in 6s
fix: correct proxy_pass configuration for API requests in nginx
2025-09-09 03:51:37 +02:00

41 lines
882 B
Nginx Configuration File

upstream frontend {
server frontend:3000;
}
upstream backend {
server backend:8000;
}
server {
listen 80;
server_name localhost;
location /health {
return 200 "OK";
access_log off;
}
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
send_timeout 300s;
location /api/ {
proxy_pass http://backend/;
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 / {
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;
proxy_pass http://frontend;
}
}