ERR_TOO_MANY_REDIRECTS error


#1

Hi,

I was able to successfully use letsencrypt to setup SSL on one of my domains. However, I tried adding a second domain hosted on the same server but I get a browser error “ERR_TOO_MANY_REDIRECTS” when trying to load the https version of the site.

My server is on DO, Ubuntu 14.04/apache 2.4.7.

I can’t for the life of me figure out why https://www.seconddomain.com (for example) has redirect errors. The HTTP version works perfectly fine so I believe I have the virtual hosts files setup correctly.

Anyone have any ideas?


What is the correct CloudFlare configuration to use once certs are installed?
#2

Is there a redirect to https inside <VirtualHost *:443>? That’s what the letsencrypt client did by default for me. Obviously https should not redirect to https.


#3

Holy crap,!!! Yes there was.

Thank you, that fixed it!

EDIT: Thinking about it now. I realize what it did. I copied the firstdomain.com.conf to seconddomain.com.conf AFTER I setup the firstdomain’s cert…which had the http -> https redirect in it. So when I setup seconddomain’s cert…it copied the redirect lines over to the ssl conf file causing the infinite loop.


#4

I’ve got the same problem… but I am not clear on the fix. Can you elaborate?

What needs to be changed to what?

I have:

domain.com
second.domain.com

and www should be just an alias for domain.com - it was correctly redirecting from www.domain.com to domain.com.

Post installation, all have an infinite redirect loop.

Thanks.


Infinite redirect error
#5

@ninedogger @xordspar0

Can you help?

What does " <VirtualHost *:443>" have to be changed to?

In the old working configuration in place of this I had this “<VirtualHost *:80>”.

Thanks.


#6

What does your “<VirtualHost *:443>” say now?

If you post what you have, it will be easier to tell you what’s wrong :slight_smile:

The last time I had redirect issues, it was because I’d forgotten a “/” at the end of a line. While the site seemed to work just fine, it caused certbot to fail with an unhelpful message. There are so many subtle things that can go wrong, we’d need to see what you’ve done first!


#7

Hi Steve,

Before installing Let’s Encrypt it was <VirtualHost *:80> and now it is <VirtualHost: *:443>.

It seems like perhaps the problem is coming from CloudFlare’s Flexible SSL though…

Thanks.


#8

I’m on Nginx (not Apache), but the ERR_TOO_MANY_REDIRECTS was a head scratcher till I read your reply about CloudFlare’s Flexible SSL.

Ended up changing my settings in CloudFlare to use Full (Strict) SSL instead of Flexible and that eliminated the error.


#9

This comment saved me, thank you.


#10

This comment about Cloudflare saved me as well. As soon as I changed that setting, everything was a green light. Can anyone elaborate on why this is happening, just for better understanding?


#11

This saved me too, Thanks a lot!


#12

Thanks, saved me too :slight_smile: