-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhaproxy.cfg
More file actions
57 lines (47 loc) · 1.44 KB
/
haproxy.cfg
File metadata and controls
57 lines (47 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
global
log /dev/log local0
log /dev/log local1 notice
maxconn 2000
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http_front
bind *:80
mode http
# CORS Headers
http-response set-header Access-Control-Allow-Origin "*"
http-response set-header Access-Control-Allow-Headers "*"
http-response set-header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
# Pre-flight
acl preflight method OPTIONS
http-request return status 204 if preflight
# Routes
acl is_auth path_beg /auth-backend
acl is_videos path_beg /videos-backend
acl is_watchlist path_beg /watchlist-backend
use_backend auth_backend if is_auth
use_backend videos_backend if is_videos
use_backend watchlist_backend if is_watchlist
default_backend frontend_backend
backend frontend_backend
mode http
server frontend frontend:8080 check
backend auth_backend
mode http
http-request replace-path /auth-backend/(.*) /\1
server auth auth_service:5000 check
backend videos_backend
mode http
http-request replace-path /videos-backend/(.*) /\1
server videos video_service:5001 check
backend watchlist_backend
mode http
http-request replace-path /watchlist-backend/(.*) /\1
server watchlist watchlist_service:5002 check