mirror of
https://github.com/taylanbakircioglu/haproxy-openmanager.git
synced 2026-09-24 03:16:24 +00:00
49 lines
1.4 KiB
Nginx Configuration File
49 lines
1.4 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;
|
|
|
|
# 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;
|
|
}
|
|
}
|
|
} |