Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Settings forcing connections to HTTPS?

Discussion in 'Workarounds and Optimization' started by inspiredearth, Mar 7, 2018.

  1. inspiredearth

    inspiredearth Member

    Joined:
    Dec 1, 2015
    Messages:
    19
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    New Zealand
    cPanel Access Level:
    Reseller Owner
    Hi..

    I have added Redis and Nginx to a WHM/CP server, following the excellent instructions and scripts provided and recommended by @Jcats on this thread: Extremely slow TTFB

    There's one part where I've come a bit unstuck.

    According to the information here, I understand I need to set Cloudflare to use "Flexible SSL" in order to gain the full benefits of the Nginx implementation. However, when I set it to "Flexible", once Cloudflare has had a change to update itself, I ended up unable to load the site. We have just two sites on the server, sharing the one dedicated IP.

    They end up in redirect loop (ERR_TOO_MANY_REDIRECTS).

    Looking for information on this, I found the following article on cloudflare.com: Why does Flexible SSL cause a redirect loop?

    It says,

    We have no relevant rewrite rules in the .htaccess files on the two sites. So I am assuming they are either occurring at a WHM Apache server level, or maybe in the Nginx plug-in.

    I would like to know if there are any settings in WHM that might force HTTP requests over to HTTPS?

    Or, if anyone else has encountered this issue, and has a solution.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,765
    Likes Received:
    79
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    There is only 2 place where this can actually occur, one is at the .htaccess level and other is at the webserver level. I doubt that there would be such redirection looping set in the cPanel provided Apache.. However, there could be possibility of having it in the Nginx, so you have to check the Nginx settings once again to check for this..

    What does the Nginx and Apache error logs suggests when the actual redirect error occurs? Open up to SSH login session and execute the below command one on each terminal and then browse the website where you see redirect loop..
    # tail -f /usr/local/apache/logs/error_logs.
    # tail -f /var/log/nginx/error_logs


    On more thing you can try is try renaming the .htaccess file in the account to see if that provides any effect on the website regarding the redirect loop..

    # mv .htaccess .htaccess-org
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,247
    Likes Received:
    1,759
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    There's nothing configured to force redirects by default in cPanel & WHM, except in the case of access attempts to cPanel/WHM/Webmail (see the "Redirection" section in "WHM >> Tweak Settings").

    If you are using Engintron, check out their document here regarding the custom rules file:

    Engintron & the "Custom Rules" file (for Nginx) · engintron/engintron Wiki · GitHub

    Thank you.
     
  4. inspiredearth

    inspiredearth Member

    Joined:
    Dec 1, 2015
    Messages:
    19
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    New Zealand
    cPanel Access Level:
    Reseller Owner
    cPanelMichael, thanks for the suggestion.
    Thanks for the input 24x7server.
    I've resolved it. The documentation for Engintron was incomplete (or obscure). It's now been updated to reflect the fact if you have an SSL certificate on the origin server, then SSL settings in CF must be set to "Strict", as opposed to the suggested "Flexible".
     
    cPanelMichael likes this.
Loading...

Share This Page