Help with backend


#1

backend HA_NODES
balance roundrobin
mode http
option httpchk GET /health_check.json
description HA_NODES
server app1-stg-7878 10.10.7.31:7878 check fastinter 2000 inter 7000
server app1-stg-7879 10.10.7.31:7879 check fastinter 2000 inter 7000
server app2-stg-7878 10.10.7.32:7878 check fastinter 2000 inter 7000
server app2-stg-7879 10.10.7.32:7879 check fastinter 2000 inter 7000
acl allow_port dst_port 80
http-request allow if allow_port

frontend HA_FRONTEND_HTTPS
bind *:443 ssl crt /etc/ssl/private/code.com.pem
mode http
http-request set-header X-Request-Start t=%Ts%ms
description HA_FRONTEND_HTTPS
default_backend HA_NODES
acl allow_port2 dst_port 443
http-request allow if allow_port2

frontend HA_FRONTEND_HTTP
bind *:80
mode http
http-request set-header X-Request-Start t=%Ts%ms
description HA_FRONTEND_HTTP
default_backend HA_NODES

Please help with my configuration. I’m new with haproxy.
I want to allow internal connections for port 80 or 8080 and only allow 443 for my external connection.

This configuration doesn’t restrict anything. I tried commenting out the frontend HA_FRONTEND_HTTP part then restarted haproxy service but I can still access it using port 80.