Files
thoughts/nginx/nginx.conf
Gabriel Kaszewski c6f7dfe225
All checks were successful
Build and Deploy Thoughts / build-and-deploy-local (push) Successful in 7s
feat: add health check endpoint to nginx configuration
2025-09-09 03:49:19 +02:00

43 lines
919 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/ {
rewrite /api/(.*) /$1 break;
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://backend;
}
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;
}
}