Skip to content

Instantly share code, notes, and snippets.

@yaacov
Last active April 29, 2019 08:02
Show Gist options
  • Save yaacov/bd0a7797f78b9a6df795125ce6cfd90a to your computer and use it in GitHub Desktop.
Save yaacov/bd0a7797f78b9a6df795125ce6cfd90a to your computer and use it in GitHub Desktop.
haproxy
sudo dnf install haproxy
sudo setsebool -P haproxy_connect_any=1
sudo vim /etc/haproxy/haproxy.cfg
```
#---------------------------------------------------------------------
# pass through SSL for api and apps
#---------------------------------------------------------------------
frontend https_api
bind *:6443
mode tcp
option tcplog
default_backend api_test1_tt_testing
acl host_openshift_authentication hdr(host) -i openshift-authentication-openshift-authentication.apps.test1.tt.testing
use_backend openshift_authentication if host_openshift_authentication
frontend https_apps
bind *:443
mode tcp
option tcplog
default_backend apps_test1_tt_testing
frontend http_apps
bind *:80
mode tcp
option tcplog
default_backend apps_test1_tt_testing
#---------------------------------------------------------------------
# define api and apps backends
#---------------------------------------------------------------------
backend openshift_authentication
mode tcp
balance roundrobin
server web01 192.168.126.51:6443
backend api_test1_tt_testing
mode tcp
balance roundrobin
server web02 192.168.126.11:6443
backend apps_test1_tt_testing
mode tcp
balance roundrobin
server web03 192.168.126.51:443
backend app_test1_tt_testing
mode tcp
balance roundrobin
server web03 192.168.126.51:80
```
sudo systemctl start haproxy.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment