PZY
PZY

Reputation: 151

How haproxy frontend not 443 port balance backend 443?

my haproxy configuration is:

# Configuration for 678da17a-5c8f-4d2b-9431-f3019aae9726
global
    daemon
    user nobody
    group haproxy
    log /dev/log local0 debug alert
    log /dev/log local1 notice alert
    maxconn 2000
    stats socket /var/lib/neutron/lbaas/v2/678da17a-5c8f-4d2b-9431-f3019aae9726/haproxy_stats.sock mode 0666 level user

defaults
    log global
    retries 3
    option redispatch
    timeout connect 5000
    timeout client 50000
    timeout server 50000

frontend 8e85521c-f92b-401a-a72f-9f3d9dbd9deb
    option tcplog
    bind 123.44.44.44:5200
    mode tcp
    default_backend 46a948a1-1043-437d-83d0-e25acf0c94fd

backend 46a948a1-1043-437d-83d0-e25acf0c94fd
    mode tcp
    balance roundrobin
    server 9add0118-0255-4ee3-998a-875fb251624b 123.23.23.23:443 weight 1

I want to configure frontend using 5200 port to access backend server 123.23.23.23:443. But when i request https://123.44.44.44:5200, the request change to https://123.44.44.44/index.html. It leads to request failure. Why happens that?

Upvotes: 0

Views: 170

Answers (1)

Aleksandar
Aleksandar

Reputation: 2672

Looks like the server software on 9add0118-0255-4ee3-998a-875fb251624b send a redirect.

You should tell the server software on 9add0118-0255-4ee3-998a-875fb251624b to redirect to 123.44.44.44:5200 instead of there own IP.

You can see what the server send back in haproxy debug frontend mode.
haproxy -d <OPTIONAL_MORE_OPTIONS>

Doc: Starting HAProxy

Upvotes: 1

Related Questions