Keep Server Online
  
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
  
or
  
 
  
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
  
Thank You! Steffen
  
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
 |    |   
 | 
     Topic: Too Many Redirect with CF | 
 |   
| Author | 
  | 
 
tonysar
 
 
  Joined: 01 Dec 2023 Posts: 4 Location: Canada
  | 
 Posted: Sun 17 Dec '23 2:20    Post subject: Too Many Redirect with CF | 
     | 
 
  | 
 
Hello. 
 
Save my Life please    
 
Linux Ubuntu vps , Apache2 Reverse proxy, ASP.NET upstream , Lets Encrypt SSL . 
 
 
Currently with this setup site function with few minor issues. ( mixed content blocking ) . was suggested to proxy connection from CloudFlare. doing so , I get Too many redirect error as soon as i turn DSN proxied on. 
 
is been almost 3 weeks i am at this trying to fix problem . so i do believe issue comes from my vhost or apache setup. and i can not trace this issue. 
 
 
this is my Vhost configuration .. 
 
 	  | Code: | 	 		  
 
<VirtualHost *:80>
 
        ServerAdmin admin@supplysolution.ca
 
        DocumentRoot /var/www/solution/html
 
#       ProxyPreserveHost On
 
#        ProxyPass / http://127.0.0.1:5000/ 
 
#        ProxyPassReverse / http://127.0.0.1:5000/
 
        ServerName supplysolution.ca
 
 #       ServerAlias www.supplysolution.ca
 
#       ProxyRequests off
 
       <Directory /var/www/solution/>
 
          Options FollowSymLinks
 
          AllowOverride None
 
          Require all granted
 
      </Directory>
 
        
 
        ErrorLog ${APACHE_LOG_DIR}/error.log
 
        CustomLog ${APACHE_LOG_DIR}/access.log combined
 
 
RewriteEngine On
 
RewriteCond %{SERVER_NAME} =www.supplysolution.ca [OR]
 
RewriteCond %{SERVER_NAME} =supplysolution.ca
 
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
 
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=301,L]
 
</VirtualHost>
 
<IfModule mod_ssl.c>
 
 
<VirtualHost *:443>
 
 
        ServerAdmin admin@supplysolution.ca
 
        DocumentRoot /var/www/solution/html
 
        Protocols       h2 http/1.1
 
        ProxyPreserveHost On
 
        ProxyPass / http://127.0.0.1:5000/
 
        ProxyPassReverse / http://127.0.0.1:5000/
 
        ServerName supplysolution.ca
 
        ServerAlias www.supplysolution.ca
 
        ProxyRequests off
 
        #LogLevel info ssl:warn
 
 
        ErrorLog ${APACHE_LOG_DIR}/error.log
 
        CustomLog ${APACHE_LOG_DIR}/access.log combined
 
        
 
        SSLEngine on
 
        SSLProxyEngine on
 
        ProxyPreserveHost on
 
        SSLCertificateFile /etc/letsencrypt/live/supplysolution.ca/fullchain.pem
 
        SSLCertificateKeyFile /etc/letsencrypt/live/supplysolution.ca/privkey.pem
 
        Include /etc/letsencrypt/options-ssl-apache.conf
 
        #Header always set Strict-Transport-Security "max-age=63072000"
 
 
 
</VirtualHost>
 
SSLUseStapling On
 
SSLStaplingCache "shmcb:logs/ssl_stapling(32768)"
 
</IfModule>
 
 | 	  
 
I would really appreciate if anyone can help me out with this. 
 
Thanks | 
 
  | 
 
| Back to top | 
 | 
 
tangent Moderator
 
  Joined: 16 Aug 2020 Posts: 400 Location: UK
  | 
 Posted: Tue 19 Dec '23 19:16    Post subject:  | 
     | 
 
  | 
 
Apache configuration aside, have you captured what the client actually receives when you get the "Too many redirects" error?
 
 
If you turn on Network tracing in Developer Tools (Shift+Cntrl+I) in Firefox or Chrome, you should be able to work out what's going wrong from the response headers and body, and get a steer on what additional configuration changes are needed, and where. | 
 
  | 
 
| Back to top | 
 | 
 
csdude55
 
 
  Joined: 22 Jan 2023 Posts: 23 Location: USA, Wilkesboro
  | 
 Posted: Fri 22 Dec '23 7:40    Post subject:  | 
     | 
 
  | 
 
I had a similar issue! I changed LogLevel to "warn", and quickly saw that my errors were coming from bad bots, etc that were being sent to 403 [F].
 
 
I implemented an exception in my configuration to stop all rules if they were at 403, and that solved my problem.
 
 
HTH! | 
 
  | 
 
| Back to top | 
 | 
 
 
 
 
 | 
 
 
 |  
 
 |  
  |   
 |