Jump to content

Cart & Client area 302 redirect loop (nginx SSL)


wifiguys

Recommended Posts

I just migrated our whmcs install to a new server, ubuntu 10.04 + nginx 1.0.6 with php-fpm 5.3.5

 

 

The main page loads fine, and I can log into the admin control panel just fine as well.

 

The problem is with our shopping cart and client area. Whenever I attempt to load them, it just does a 302 redirect loop.

 

I've narrowed it down to an SSL issue. In the admin area, I have the following values:

 

WHMCS System URL = http://billing.mydomain.com/

WHMCS SSL System URL = https://billing.mydomain.com/

 

 

If I leave the SSL system URL blank, the pages load fine. If I fill in the SSL system URL, the pages enter into a 302 redirect loop, constantly trying to redirect to the https version of the page.

 

 

SSL is working, the site/whmcs loads fine with https. It's this setting which is constantly redirecting.

 

Is there an error in WHMCS's SSL detection with nginx which doesn't allow it to detect that it is already https, so it constantly tries redirecting to https?

Link to comment
Share on other sites

UPDATE

 

The issue was due to WHMCS's "ssl detection" algorithm checking the $_SERVER["HTTPS"] variable. My nginx/fastcgi setup was not populating that by default with the fastcgi_params.

 

I had to update my fastcgi_params to default to:

 

fastcgi_param HTTPS off;

 

And then in my server block:

 

server {

listen 443 ssl;

.

.

location ~ \.php

{

include fastcgi_params;

fastcgi_param HTTPS on;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

}

}

 

 

Now the $_SERVER["HTTPS"] variable is populated, and the ssl redirection / detection is working properly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated