forked from canonical/lxd-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhaproxy-demo.cfg
More file actions
34 lines (28 loc) · 927 Bytes
/
Copy pathhaproxy-demo.cfg
File metadata and controls
34 lines (28 loc) · 927 Bytes
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
global
daemon
user haproxy
defaults
mode http
timeout connect 500000
timeout client 500000
timeout server 500000
frontend lxd_frontend
bind 0.0.0.0:80
acl is_core path_beg /1.0
acl is_docs path_beg /documentation
acl is_backend_allowed hdr_sub(cookie) lxdUiBackend=LXD_UI_BACKEND_SECRET
use_backend lxd_core if is_core is_backend_allowed
use_backend lxd_core if is_docs is_backend_allowed
use_backend lxd_core_denied if is_core !is_backend_allowed
use_backend lxd_ui_denied if !is_backend_allowed
default_backend lxd_ui
backend lxd_ui
server yarn_serve_port 127.0.0.1:VITE_PORT
backend lxd_ui_denied
mode http
http-request return status 200 content-type "text/plain" string "Please contact maintainers to get access!"
backend lxd_core
server lxd_https LXD_UI_BACKEND_IP:8443 ssl verify none crt /srv/key.pem
backend lxd_core_denied
mode http
http-request deny deny_status 403