-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhaproxy.cfg
40 lines (27 loc) · 1.01 KB
/
haproxy.cfg
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
global
maxconn 256
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http
bind *:3002
# Force SSL
# redirect scheme https code 301 if ! { hdr(x-forwarded-proto) https }
# Redirect visits index and show requests to the `flights1-react` app.
acl react_assets path_beg /react_app
acl react_task_app url_reg -i /
use_backend flights1-react if METH_GET react_task_app
# And all other requests to `flights-rails`.
default_backend flights-rails
backend flights-rails
http-request set-header X-Forwarded-Host %[req.hdr(Host)]
http-request set-header X-Forwarded-Port %[dst_port]
http-request replace-path ^Host: Host:\ localhost:3001
server flights-rails localhost:3001
backend flights1-react
http-request set-header X-Forwarded-Host %[req.hdr(Host)]
http-request set-header X-Forwarded-Port %[dst_port]
http-request replace-path ^Host: Host:\ localhost:3000
server flights1-react localhost:3000