Добавлена связь с фронтом админки

This commit is contained in:
2026-04-26 22:48:57 +03:00
parent 762fb1a4f2
commit 62bc62f990
4 changed files with 65 additions and 26 deletions

View File

@@ -19,11 +19,11 @@ http:
plugin:
coraza:
directives:
# - "SecRuleEngine DetectionOnly"
# - "SecRuleEngine DetectionOnly" # можно раскомментировать для тестирования
- "SecRuleEngine On"
- "SecDebugLog /dev/stdout"
- "SecDebugLogLevel 2"
# - "SecRule REQUEST_URI \"@rx /admin\" \"id:101,phase:1,log,deny,status:403\""
# - "SecRule REQUEST_URI \"@rx /admin\" \"id:101,phase:1,log,deny,status:403\""
- "SecRule ARGS \"@rx (union|select|insert|drop|alter)\" \"id:102,phase:2,log,deny,status:403\""
api-ratelimit:
@@ -39,7 +39,7 @@ http:
burst: 5
routers:
# REST API пользователей
# --- REST API пользователей ---
api:
rule: "Host(`api.eventhub.local`)"
entryPoints: ["web"]
@@ -52,7 +52,7 @@ http:
middlewares: ["api-ratelimit", "waf"]
service: "api"
# WebSocket пользователей (без WAF)
# --- WebSocket пользователей (без WAF) ---
ws:
rule: "Host(`ws.eventhub.local`)"
entryPoints: ["web"]
@@ -64,33 +64,45 @@ http:
tls: true
service: "ws"
# Админский REST
admin-api:
rule: "Host(`admin.eventhub.local`)"
# --- Админ-панель (SPA) ---
admin-ui:
rule: "Host(`admin.eventhub.local`) && !PathPrefix(`/api/`) && !PathPrefix(`/ws/`)"
entryPoints: ["web"]
middlewares: ["redirect-to-https"]
service: "admin-ui-service"
admin-ui-secure:
rule: "Host(`admin.eventhub.local`) && !PathPrefix(`/api/`) && !PathPrefix(`/ws/`)"
entryPoints: ["websecure"]
tls: true
service: "admin-ui-service"
# --- Проксирование /api/ на админский REST ---
admin-api-proxy:
rule: "Host(`admin.eventhub.local`) && PathPrefix(`/api/`)"
entryPoints: ["web"]
middlewares: ["redirect-to-https", "admin-ratelimit", "waf"]
service: "admin-api"
admin-api-secure:
rule: "Host(`admin.eventhub.local`)"
admin-api-proxy-secure:
rule: "Host(`admin.eventhub.local`) && PathPrefix(`/api/`)"
entryPoints: ["websecure"]
tls: true
middlewares: ["admin-ratelimit", "waf"]
service: "admin-api"
# Админский WebSocket (без WAF)
admin-ws:
rule: "Host(`admin-ws.eventhub.local`)"
# --- Проксирование /ws/ на админский WebSocket ---
admin-ws-proxy:
rule: "Host(`admin.eventhub.local`) && PathPrefix(`/ws/`)"
entryPoints: ["web"]
middlewares: ["redirect-to-https"]
service: "admin-ws"
admin-ws-secure:
rule: "Host(`admin-ws.eventhub.local`)"
admin-ws-proxy-secure:
rule: "Host(`admin.eventhub.local`) && PathPrefix(`/ws/`)"
entryPoints: ["websecure"]
tls: true
service: "admin-ws"
services:
# Пользовательский REST API (failover)
# --- Пользовательский REST API (failover) ---
api:
failover:
service: api-live
@@ -110,7 +122,7 @@ http:
servers:
- url: "http://fallback:80"
# Пользовательский WebSocket
# --- Пользовательский WebSocket ---
ws:
loadbalancer:
servers:
@@ -118,7 +130,7 @@ http:
- url: "http://eventhub-node2:8081"
- url: "http://eventhub-node3:8081"
# Админский REST (failover)
# --- Админский REST (failover) ---
admin-api:
failover:
service: admin-api-live
@@ -138,10 +150,16 @@ http:
servers:
- url: "http://fallback:80"
# Админский WebSocket
# --- Админский WebSocket ---
admin-ws:
loadbalancer:
servers:
- url: "http://eventhub-node1:8446"
- url: "http://eventhub-node2:8446"
- url: "http://eventhub-node3:8446"
- url: "http://eventhub-node3:8446"
# --- SPA (админ‑панель) ---
admin-ui-service:
loadbalancer:
servers:
- url: "http://admin-ui:80"