HAProxy: Difference between revisions

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


==Load Balancing==
==Load Balancing==
  frontend chorke-portals
  frontend chorke-http
     bind *:80
     bind *:80
     mode http
     mode http
     default_backend chorke-servers
     default_backend chorke-minio
   
   
  backend chorke-servers
  backend chorke-minio
     server minio1 127.0.0.1:1983
     server minio1 127.0.0.1:1983
     mode http
     mode http


==Reverse Proxy==
==Reverse Proxy==
  frontend chorke-frontend
  frontend chorke-http
     bind *:80
     bind *:80
     mode http
     mode http
     acl path-prefix-is-minio  path_beg /minio/
     acl path-prefix-is-minio  path_beg /minio/
     use_backend minio-backend if path-prefix-is-minio
     use_backend chorke-minio if path-prefix-is-minio
   
   
  backend minio-backend
  backend chorke-minio
     server minio1 127.0.0.1:9801
     server minio1 127.0.0.1:9801
     mode http
     mode http

Revision as of 00:34, 19 April 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 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