HAProxy Rocky unverschlüsselt

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

HAProxy als Reverse Proxy unter Rocky Linux

Voraussetzungen

  • Rocky Linux mit installiertem Paket haproxy
  • Servername: haproxy1.it213.int
  • IP-Adresse: 192.168.178.6
  • Zielsystem: 192.168.178.7 Port 80

Installation

  • dnf install haproxy -y

Firewall-Konfiguration (Rocky/Firewalld)

  • firewall-cmd --add-service=http --permanent
  • firewall-cmd --reload

HAProxy-Konfiguration

global
    log /dev/log local0
    log /dev/log local1 notice
    chroot /var/lib/haproxy
    stats timeout 30s
    user haproxy
    group haproxy
    daemon

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    timeout connect 5s
    timeout client  50s
    timeout server  50s

frontend fe_http
    bind 192.168.178.6:80
    default_backend be_target

backend be_target
    server srv1 192.168.178.7:80 check

Dienst neu starten

  • systemctl restart haproxy
  • systemctl enable haproxy
  • systemctl status haproxy

Funktionstest