HAProxy: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:


==Reverse Proxy==
==Reverse Proxy==
{|
| valign="top" |
frontend chorke-http
    bind *:80
    mode http
    acl host-is-chorke hdr(host) -i chorke.local
    acl path-prefix-is-services  path_beg /services/
    use_backend chorke-servers if host-is-chorke path-prefix-is-services
    use_backend chorke-clients if host-is-chorke
backend chorke-servers
    server apache 127.0.0.1:2013
    mode http
backend chorke-clients
    server apache 127.0.0.1:3000
    mode http
| valign="bottom" |
  frontend chorke-http
  frontend chorke-http
     bind *:80
     bind *:80
Line 25: Line 44:
     server minio1 127.0.0.1:9801
     server minio1 127.0.0.1:9801
     mode http
     mode http
|}


==Knowledge==
==Knowledge==

Revision as of 09:59, 10 August 2023

sudo apt install haproxy
sudo apt install --no-install-recommends software-properties-common
sudo add-apt-repository ppa:vbernat/haproxy-2.4 -y
sudo apt install haproxy=2.4.\*
haproxy -v

Load Balancing

frontend chorke-http
   bind *:80
   mode http
   default_backend chorke-minio

backend chorke-minio
   server minio1 127.0.0.1:1983
   mode http

Reverse Proxy

frontend chorke-http
   bind *:80
   mode http
   acl host-is-chorke hdr(host) -i chorke.local
   acl path-prefix-is-services  path_beg /services/
   use_backend chorke-servers if host-is-chorke path-prefix-is-services
   use_backend chorke-clients if host-is-chorke

backend chorke-servers
   server apache 127.0.0.1:2013
   mode http

backend chorke-clients
   server apache 127.0.0.1:3000
   mode http
frontend chorke-http
   bind *:80
   mode http
   acl path-prefix-is-minio  path_beg /minio/
   use_backend chorke-minio if path-prefix-is-minio

backend chorke-minio
   server minio1 127.0.0.1:9801
   mode http

Knowledge

sudo ss -tulwn | grep LISTEN
sudo ss -tulpn | grep LISTEN
sudo ss -tulpn | grep LISTEN | grep sshd
sudo ss -tulpn | grep LISTEN | grep minio
sudo ss -tulpn | grep LISTEN | grep resolve

References