Apache Lounge


About Forum Index Downloads Search Register Log in RSS X

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Too Many Redirect with CF

Joined: 01 Dec 2023
Posts: 4
Location: Canada

PostPosted: Sun 17 Dec '23 2:20    Post subject: Too Many Redirect with CF Reply with quote

Save my Life please Rolling Eyes
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 ..

<VirtualHost *:80>
        ServerAdmin admin@supplysolution.ca
        DocumentRoot /var/www/solution/html
#       ProxyPreserveHost On
#        ProxyPass /
#        ProxyPassReverse /
        ServerName supplysolution.ca
 #       ServerAlias www.supplysolution.ca
#       ProxyRequests off
       <Directory /var/www/solution/>
          Options FollowSymLinks
          AllowOverride None
          Require all granted
        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]
<IfModule mod_ssl.c>

<VirtualHost *:443>

        ServerAdmin admin@supplysolution.ca
        DocumentRoot /var/www/solution/html
        Protocols       h2 http/1.1
        ProxyPreserveHost On
        ProxyPass /
        ProxyPassReverse /
        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"

SSLUseStapling On
SSLStaplingCache "shmcb:logs/ssl_stapling(32768)"

I would really appreciate if anyone can help me out with this.
Back to top

Joined: 16 Aug 2020
Posts: 333
Location: UK

PostPosted: Tue 19 Dec '23 19:16    Post subject: Reply with quote

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

Joined: 22 Jan 2023
Posts: 23
Location: USA, Wilkesboro

PostPosted: Fri 22 Dec '23 7:40    Post subject: Reply with quote

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.

Back to top

Reply to topic   Topic: Too Many Redirect with CF View previous topic :: View next topic
Post new topic   Forum Index -> Apache