I’m trying to use a static site (S3 + Cloudfront) as a backend in my HAProxy configuration. The static service is configured to redirect HTTP requests to HTTPS. So —
# Gives a #301
curl <site>.cloudfrount.net
and
# Gives a 200
curl https://<site>.cloudfront.net
However, if I enter this as a backend in HAProxy —
backend my_server
http-response set-header Strict-Transport-Security max-age=31536000
server my_server <id>.cloudfront.net ssl verify none
I get a bunch of IP address of my_server
changed from to logs continuously, and whenever I hit a route which evaluates to use the cloudfront backend, I receive a message
Failed to connect() no free ports`
I suspect this is because HAProxy is falling into a redirect loop. Is this because HAProxy is not making a https
call to the server? How can I ensure it does?
7 posts - 2 participants