I am using Haproxy as frontend loadbalancer, version: 1.5.4 2014/09/02
Backend is on the same server, an apache:8080 running on Centos6.
Now I am trying to migrate this website to https using letsencrypt.
I have installed the certs through Certbot.
Then concatenated fullchain.pem and privkey.pem and placed it in /etc/haproxy dir as instructed on certbot and various other sites.
I have not yet setup the renew, as I want to test this out first. I hope that’s fine.
So all that appears to go fine.
However when I try to browse the website, following happens:
The web-app’s login page redirect to https OK, but when I enter user credential and do submit, the url redirects to https://<domain>:80 and it throws error ERR_SSL_PROTOCOL_ERROR and on the server side
That’s your application making a bogus redirect (HTTPS to port 80). Make sure your application knows that you are already forcing HTTPS on haproxy and disable any redirects from the application.
How do you say that?
I need some more help as I don’t know where to look.
I grep’ed through my php server code for “SERVER_PORT”, it’s not used anywhere.