docker-archive / dockercloud-haproxy

HAproxy image that autoreconfigures itself when used in Docker Cloud
https://cloud.docker.com/
652 stars 181 forks source link

http redirect to https not working with FORCE_SSL #106

Closed danielkermode closed 8 years ago

danielkermode commented 8 years ago

Hello, I've set up the haproxy container on Docker Cloud and linked it to my server. I have a valid certificate from Let's Encrypt, and set up SSL termination as described by setting DEFAULT_SSL_CERT, VIRTUAL_HOST and FORCE_SSL. https works correctly. However, http requests do not redirect. If I expose ports 443 and 80, http requests simply go to the http site, whereas if I only expose 443 http requests don't work at all and https must be typed in the browser.

I understood that FORCE_SSL redirects http requests to https? Or am I missing something?

tifayuki commented 8 years ago

@danielkermode

Can you check if you have the same issue here: https://github.com/docker/dockercloud-haproxy/issues/19

danielkermode commented 8 years ago

Thanks for the quick reply, unfortunately changing VIRTUAL_HOST to 'http://domain, https://domain' doesn't seem to fix the issue.

danielkermode commented 8 years ago

Got it working, I believe I missed setting FORCE_SSL on the server container as well? Anyway thanks again for the help.