doc: Improve HAProxy example
This commit is contained in:
parent
87f9a0b152
commit
58593c6f04
|
|
@ -0,0 +1,2 @@
|
||||||
|
make:
|
||||||
|
haproxy -f ./haproxy.conf
|
||||||
|
|
@ -1,15 +1,32 @@
|
||||||
|
global
|
||||||
|
stats socket /var/run/haproxy/admin.sock mode 660 level admin
|
||||||
|
log stdout local0
|
||||||
|
|
||||||
|
|
||||||
frontend cleartext_frontend
|
frontend cleartext_frontend
|
||||||
bind 0.0.0.0:80
|
bind 0.0.0.0:8080
|
||||||
|
|
||||||
|
timeout client 10s
|
||||||
|
|
||||||
|
stats enable
|
||||||
|
stats uri /stats
|
||||||
|
stats refresh 30s
|
||||||
|
|
||||||
|
log global
|
||||||
option httplog
|
option httplog
|
||||||
|
option dontlognull
|
||||||
|
log-format "[%t] %ci:%cp -> BACKEND:%b/%s | %HM %HU | Status:%ST | Bytes:%B"
|
||||||
|
mode http
|
||||||
|
|
||||||
use_backend be_olivetin_webs if { hdr(Host) -i olivetin.example.com && path_beg /websocket }
|
use_backend be_olivetin if { hdr(Host) -i -m beg olivetin.example.com }
|
||||||
use_backend be_olivetin_http if { hdr(Host) -i olivetin.example.com }
|
|
||||||
|
|
||||||
backend be_olivetin_http
|
backend be_olivetin
|
||||||
server olivetinServer 127.0.0.1:1337 check
|
mode http
|
||||||
|
timeout connect 10s
|
||||||
backend be_olivetin_webs
|
timeout server 10s
|
||||||
timeout tunnel 1h
|
timeout tunnel 1h
|
||||||
option http-server-close
|
option http-server-close
|
||||||
server olivetinServer 127.0.0.1:1337
|
http-request set-header X-Forwarded-User "Alice"
|
||||||
|
http-request set-header X-Forwarded-Group "Group1,Group2"
|
||||||
|
server olivetinServer 127.0.0.1:1337 check
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue