tedd
(Ftokarev)
July 4, 2011, 5:15pm
1
Looks like CHttpRequest’s decision on whether we have a SSL request or not is based on the server variable called HTTPS:
public function getIsSecureConnection()
{
return isset($_SERVER['HTTPS']) && !strcasecmp($_SERVER['HTTPS'],'on');
}
But nginx doesn’t define such a variable.
Obviously we should add it:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
...
fastcgi_param HTTPS on;
...
}
Voila!
Hope it will save some of your time
zekus
(Zekus One)
July 5, 2011, 8:17am
2
Just to clarify… this trick does not work if you are using Nginx as a reverse proxy to Apache. Apache refuses to accept that header and put a suffix in front of it so you have to extend the CHttpRequest and accept your own header (a bit complex but works).
prchakal
(Paulo)
July 28, 2011, 8:41pm
3
Hi,
I have the same problem.
I can change for all my application the HttpRequest class instead of update the framework class?
Is there any config in main.php that i can do it?
prchakal
(Paulo)
July 28, 2011, 8:45pm
4
Problem solved.
Only need configure using:
Ty.