Error "The page isn’t redirecting properly" after change from self-signed to lets encrypt!

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: https://healution.tk

I used to have a self-signed cert which on browsers cause a big danger sign implying the website is not safe. however my ssl/https was working fine after adding the certificate to browser’s exceptions. I decided to use let’s encrypt so followed this link. My server is a vm instance on google cloud running ubuntu 18.4 LTS server / apache2 with mod_security installed plus wordpress CMS. throughout the set up process of let’s encrypt I had to chose a dns plugin which I chosen cloudeflare. I went through steps successfully and finished the process. now I receive “The page isn’t redirecting properly” on firefox" and This page isn’t working healution.tk redirected you too many times." on chrome.

I ran this command: I reloaded/restarted apache2, didn’t solve the issue.
I thought that this redirection may come from apache config files so I tried to fix it there but nothing happened. the only page sometimes comes up shows my request is passed from cloudflare but there is a red cross on the server, probably referes to redirection issue.

when I check the communication between my browser and server in “developer tools -> network” of the browser it shows 21 requests to the server with the name healution.tk and the reply is 301 moved permanently.

It produced this output:

the 000-default-le-ssl.conf details:
"<"IfModule mod_ssl.c>
"<"VirtualHost healution.tk:443>
ServerAdmin aenz0001@student.monash.edu
# ServerName 35.243.187.120
ServerName healution.tk
DocumentRoot /var/www/html
ProxyPass / https://healution.tk:10000/
ProxyPassReverse / https://healution.tk:10000/

    Redirect permanent "/" "https://healution.tk/"

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

ServerAlias www.healution.tk
SSLCertificateFile /etc/letsencrypt/live/healution.tk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/healution.tk/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
"<"/VirtualHost>

the 000-default.conf details:

VirtualHost *:80>

    ServerAdmin aenz0001@student.monash.edu
    ServerName https://healution.tk
    DocumentRoot /var/www/html
    ProxyPass / https://healution.tk:10000/
    ProxyPassReverse / https://healution.tk:10000/

Redirect permanent “/” “https://healution.tk/

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

RewriteEngine on
RewriteCond %{SERVER_NAME} =healution.tk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
“<”/VirtualHost>

the former ssl self-signed detailes which I renamed it to (default-ssl.conf.bak):

"<"IfModule mod_ssl.c>
"<"VirtualHost default:443>
ServerAdmin aenz0001@studen.monash.edu
ServerName 35.243.187.120
DocumentRoot /var/www/html
ErrorLog {APACHE_LOG_DIR}/error.log CustomLog {APACHE_LOG_DIR}/access.log combined

SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

<FilesMatch “.(cgi|shtml|phtml|php)$”>
SSLOptions +StdEnvVars
“<” /FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
“<”/Directory>

My web server is (include version):
apache version: apache/ 2.4.29
The operating system my web server runs on is (include version):
ubuntu 18.4 LTS
My hosting provider, if applicable, is:
googlecloud - vm instance, I have shell access to my server
I can login to a root shell on my machine (yes or no, or I don’t know):
yes
I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
not control pannel, in fact I set this VM instance up myself. no gui just text-based terminal

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
certbot ver 0.31.0,

EDIT:
also below shows the site-enable links:
Screenshot%20from%202019-04-22%2018-03-01|690x93

Many thanks!

Hi @Enz0

your configuration has some errors ( https://check-your-website.server-daten.de/?q=healution.tk ): Timeouts and loops.

Domainname Http-Status redirect Sec. G
http://healution.tk/
104.31.94.52 301 https://healution.tk/ 0.234 A
http://healution.tk/
104.31.95.52 301 https://healution.tk/ 0.233 A
http://healution.tk/
2606:4700:30::681f:5e34 301 https://healution.tk/ 0.234 A
http://healution.tk/
2606:4700:30::681f:5f34 301 https://healution.tk/ 0.233 A
http://www.healution.tk/
104.31.94.52 -14 10.027 T
Timeout - The operation has timed out
http://www.healution.tk/
104.31.95.52 -14 10.026 T
Timeout - The operation has timed out
http://www.healution.tk/
2606:4700:30::681f:5e34 -14 10.030 T
Timeout - The operation has timed out
http://www.healution.tk/
2606:4700:30::681f:5f34 -14 10.026 T
Timeout - The operation has timed out
https://healution.tk/
104.31.94.52 301 https://healution.tk/ 0.446 L
https://healution.tk/
104.31.95.52 301 https://healution.tk/ 0.333 L
https://healution.tk/
2606:4700:30::681f:5e34 301 https://healution.tk/ 0.320 L
https://healution.tk/
2606:4700:30::681f:5f34 301 https://healution.tk/ 0.327 L
https://www.healution.tk/
104.31.94.52 -14 10.030 T
Timeout - The operation has timed out
https://www.healution.tk/
104.31.95.52 -14 10.030 T
Timeout - The operation has timed out
https://www.healution.tk/
2606:4700:30::681f:5e34 -14 10.026 T
Timeout - The operation has timed out
https://www.healution.tk/
2606:4700:30::681f:5f34 -14 10.027 T
Timeout - The operation has timed out

This in a 443 vHost is wrong, that's the loop. It's partially ok in a port 80 vHost (not good, but not too bad).

If you have www dns entries, your server should answer.

Hi JuergenAuer,

Thanks for prompt reply. In fact, I found what causes this issue. in Cloudflare DNS section when I choose dns only redirection works pretty fine but when I select “dns” and “http proxy (dns)” this issue appears. means when I turn the http proxy off it works ok.

at first their proxy was quite fascinating to me as I was testing one of my friends lab web server that I came to know about cloudflare proxy and it was interesting to me because I couldn’t be able to find web serve real IP address and any pentesting tool I used was just revealing dns IP but real webserver’s. So I thought that it is good if I use this proxy - and all of this is because our web servers would be challanges against security measures we have taken and we would be assessed based on that.

can you please guide me how it is possible to active cloudflare “dns” and “http proxy” shoulder to shoulder.

Screenshot%20from%202019-04-22%2019-58-27

thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.