Am I misconfiguring the load balancer?

I’m having trouble getting a simple redirect to work on the load balancer. It’s very possible I missed something silly but could use a 2nd pair of eyes.

stats-and-archives-asp-site is the primary mysite.com site and is hosted outside of rancher. My objective is to use Rancher for SSL termination so requests are still served from the primary asp-based site. This target has a health check on it which is passing.

When I visit the root domain (which I’ve modified my local /etc/hosts to point to the load balancer) I see a 503 as if the load balancer isn’t seeing the request.

Anyone have any ideas on what I should look at?

Balancer (HAproxy) use healthcheck, did you setup stats-and-archives-asp-site as a external service with healthcheck ? As fast check you can setup HAproxy to show statistics, add this to haproxy configuration:

listen stats 
bind 0.0.0.0:9000
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /haproxy_stats

and then add service rule, TCP port 9000 with lb as a target. Then you can access :9000/haproxy_stats to see status of frontends and backends (check healthcheck status).

1 Like

Thanks for following up! I just had time to get around to this. It looks like the ip address I’m redirecting to is shown as down within the ha proxy stats. However the Rancher api shows that external service as being healthy:


"healthCheck": {
"type": "instanceHealthCheck",
"healthyThreshold": 2,
"initializingTimeout": 60000,
"interval": 2000,
"name": null,
"port": 80,
"reinitializingTimeout": 60000,
"requestLine": "GET \"/Archives.aspx?VSN=BBX\" \"HTTP/1.0\"",
"responseTimeout": 2000,
"strategy": "recreate",
"unhealthyThreshold": 3
},
"healthState": "healthy",
"hostname": null,
"instanceIds": null,
"kind": "externalService",

Hm, that’s strange, if you point cursor to last check text popup window with last state should be visible (probably something like reset). You can enable haproxy logging, if you have syslog server it’s easy, also you can setup something like this https://github.com/outstand/docker-syslog-ng-stdout (sidekick container with rsyslog)