Add health proxy service and Nginx configuration for health checks

This commit is contained in:
MayaChat
2025-11-24 12:26:37 -05:00
parent aa1a38b6fb
commit af2658bfce
4 changed files with 145 additions and 10 deletions

40
nginx.conf Normal file
View File

@@ -0,0 +1,40 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
# Health proxy endpoint - forwards to internal python service
location /healthcheck {
proxy_pass http://health-proxy:8081$request_uri;
proxy_http_version 1.1;
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_connect_timeout 3s;
proxy_read_timeout 5s;
}
# Serve static files
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
}
}