Hello cakephp people from 18 months ago,
I was working on this today and fixed it.
nginx needs to be told send the SCRIPT_URI param to PHP.
put this in your facstcgi_params file
# added so that cakephp redirects https properly
# no scheme info was available in the environment/$_SERVER
# so, we define it here - see basics.php
fastcgi_param SCRIPT_URI $scheme://$host$request_uri;
HTH,
sophistry
On Saturday, March 12, 2011 4:33:43 PM UTC-5, Krissy Masters wrote:
>
> Ok sorry for all the SSL questions.
>
> I am not sure if its because I am on nginx. but all tips / guides /
> cookbook
> show
>
> function forceSSL() {
> $this->redirect('https://' . env('SERVER_NAME') . $this->here);
> }
>
> All that did was loop me never ending error.
>
> So after debugging server variables I ended up with :
>
> function forceSSL() {
> if($_SERVER['SERVER_PORT'] != "443") {
> this->redirect('https://www.' . $_SERVER['SERVER_NAME'] .
> $this->here);
> } else {
> return;
> }
> }
>
> I could never get a value from $_SERVER['HTTPS'] if I was on a https or
> http
> page.
>
> Is there anything wrong going this route? What should print
> $_SERVER['HTTPS'] ; return if anything on http || https pages?
> "Set to a non-empty value if the script was queried through the HTTPS
> protocol." Says php.net but I never got a value on either secure or not.
>
> Thanks again all,
>
> K
>
>
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.