mirror of
https://github.com/taylanbakircioglu/haproxy-openmanager.git
synced 2026-09-24 11:26:29 +00:00
9860d51839
- Backend/frontend now pull pre-built images from Docker Hub by default - Build sections commented out (can be uncommented for local builds) - Removed dev volume mount (./backend:/app) for production use - Backend healthcheck changed from curl to python urllib (curl not in slim image) - Added nginx /health endpoint for compose healthcheck Made-with: Cursor
54 lines
1.5 KiB
Nginx Configuration File
54 lines
1.5 KiB
Nginx Configuration File
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
upstream frontend {
|
|
server frontend:3000;
|
|
}
|
|
|
|
upstream backend {
|
|
server backend:8000;
|
|
}
|
|
|
|
server {
|
|
listen 8080;
|
|
server_name localhost;
|
|
|
|
location /health {
|
|
access_log off;
|
|
return 200 'ok';
|
|
}
|
|
|
|
# Frontend React App
|
|
location / {
|
|
proxy_pass http://frontend;
|
|
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;
|
|
|
|
# WebSocket support
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
# Backend API
|
|
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;
|
|
}
|
|
|
|
# HAProxy Stats (proxy to HAProxy container)
|
|
location /haproxy-stats {
|
|
proxy_pass http://haproxy-test:8404/stats;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
}
|
|
} |