Welcome! Log In Create A New Profile

Advanced

PHP-FPM automatically convert my base url into https?

Posted by WhiteX 
Hi,

Is that possible? I'm using PHP-FPM (DotDeb) with Nginx 1.2.5 (DotDeb) and
the base url of my site becomes https (also some links are converted to
htpps)
FYI, I'm using CMS Made Simple and Ajaxplorer.

Is this bug come from PHP-FPM or maybe Nginx itself?

I am desperately find the answer everywhere. Please help me.

Thank you
Do this on the PHP side:

if($_SERVER["HTTPS"] != "on") {
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://" . $_SERVER["SERVER_NAME"] .
$_SERVER["REQUEST_URI"]);
exit();
}




2012/12/11 WhiteX <donny.licoln@gmail.com>

> Hi,
>
> Is that possible? I'm using PHP-FPM (DotDeb) with Nginx 1.2.5 (DotDeb) and
> the base url of my site becomes https (also some links are converted to
> htpps)
> FYI, I'm using CMS Made Simple and Ajaxplorer.
>
> Is this bug come from PHP-FPM or maybe Nginx itself?
>
> I am desperately find the answer everywhere. Please help me.
>
> Thank you
>



--
Atenciosamente;
Felipe Braz
Linux User # 323052
Anatoly Pashin
Re: PHP-FPM automatically convert my base url into https?
December 11, 2012 01:34PM
>
> header("HTTP/1.1 301 Moved Permanently");
> header("Location: https://" . $_SERVER["SERVER_NAME"] .
> $_SERVER["REQUEST_URI"]);

301 response code should be sent by header() itself, the third argument is
for that.
And the main question was not "how can i redirect all to https by php".

@*WhiteX, *imho that's not a bug of php neither of nginx.

2012/12/12 Felipe <linux@portalaces.com>

> Do this on the PHP side:
>
> if($_SERVER["HTTPS"] != "on") {
> header("HTTP/1.1 301 Moved Permanently");
> header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
> exit();
> }
>
>
>
>
> 2012/12/11 WhiteX <donny.licoln@gmail.com>
>
>> Hi,
>>
>> Is that possible? I'm using PHP-FPM (DotDeb) with Nginx 1.2.5 (DotDeb)
>> and the base url of my site becomes https (also some links are converted to
>> htpps)
>> FYI, I'm using CMS Made Simple and Ajaxplorer.
>>
>> Is this bug come from PHP-FPM or maybe Nginx itself?
>>
>> I am desperately find the answer everywhere. Please help me.
>>
>> Thank you
>>
>
>
>
> --
> Atenciosamente;
> Felipe Braz
> Linux User # 323052
>
Re: PHP-FPM automatically convert my base url into https?
December 12, 2012 02:10AM
This could be a catch all default vhost:

server {

listen 80 default_server;
server_name _;
rewrite ^ https://domain.com permanent;

}
Hi Felipe and B1rdEX,

Right now, the situation is my base url is converted to https though I'm
not using https and have disabled https in admin panel.
Other CMSes (Drupal, Joomla dan Wordpress) work fine.

Both CMS Made Simple and Ajaxplorer have https base url. I have tried
Apache and found no problem running them.
This is really confusing.

Any recommendation?

Thanks

On Wednesday, December 12, 2012 1:32:40 AM UTC+7, B1rdEX wrote:
>
> header("HTTP/1.1 301 Moved Permanently");
>> header("Location: https://" . $_SERVER["SERVER_NAME"] .
>> $_SERVER["REQUEST_URI"]);
>
> 301 response code should be sent by header() itself, the third argument is
> for that.
> And the main question was not "how can i redirect all to https by php".
>
> @*WhiteX, *imho that's not a bug of php neither of nginx.
>
> 2012/12/12 Felipe <li...@portalaces.com <javascript:>>
>
>> Do this on the PHP side:
>>
>> if($_SERVER["HTTPS"] != "on") {
>> header("HTTP/1.1 301 Moved Permanently");
>> header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
>> exit();
>> }
>>
>>
>>
>>
>> 2012/12/11 WhiteX <donny....@gmail.com <javascript:>>
>>
>>> Hi,
>>>
>>> Is that possible? I'm using PHP-FPM (DotDeb) with Nginx 1.2.5 (DotDeb)
>>> and the base url of my site becomes https (also some links are converted to
>>> htpps)
>>> FYI, I'm using CMS Made Simple and Ajaxplorer.
>>>
>>> Is this bug come from PHP-FPM or maybe Nginx itself?
>>>
>>> I am desperately find the answer everywhere. Please help me.
>>>
>>> Thank you
>>>
>>
>>
>>
>> --
>> Atenciosamente;
>> Felipe Braz
>> Linux User # 323052
>>
>
>
António P. P. Almeida
Re: PHP-FPM automatically convert my base url into https?
December 12, 2012 02:02PM
Have you checked if there's a $_SERVER['HTTPS'] always set to 'on' or
similar?
Le 12 déc. 2012 09:35, "WhiteX" <donny.licoln@gmail.com> a écrit :

> Hi Felipe and B1rdEX,
>
> Right now, the situation is my base url is converted to https though I'm
> not using https and have disabled https in admin panel.
> Other CMSes (Drupal, Joomla dan Wordpress) work fine.
>
> Both CMS Made Simple and Ajaxplorer have https base url. I have tried
> Apache and found no problem running them.
> This is really confusing.
>
> Any recommendation?
>
> Thanks
>
> On Wednesday, December 12, 2012 1:32:40 AM UTC+7, B1rdEX wrote:
>>
>> header("HTTP/1.1 301 Moved Permanently");
>>> header("Location: https://" . $_SERVER["SERVER_NAME"] .
>>> $_SERVER["REQUEST_URI"]);
>>
>> 301 response code should be sent by header() itself, the third argument
>> is for that.
>> And the main question was not "how can i redirect all to https by php".
>>
>> @*WhiteX, *imho that's not a bug of php neither of nginx.
>>
>> 2012/12/12 Felipe <li...@portalaces.com>
>>
>>> Do this on the PHP side:
>>>
>>> if($_SERVER["HTTPS"] != "on") {
>>> header("HTTP/1.1 301 Moved Permanently");
>>> header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
>>> exit();
>>> }
>>>
>>>
>>>
>>>
>>> 2012/12/11 WhiteX <donny....@gmail.com>
>>>
>>>> Hi,
>>>>
>>>> Is that possible? I'm using PHP-FPM (DotDeb) with Nginx 1.2.5 (DotDeb)
>>>> and the base url of my site becomes https (also some links are converted to
>>>> htpps)
>>>> FYI, I'm using CMS Made Simple and Ajaxplorer.
>>>>
>>>> Is this bug come from PHP-FPM or maybe Nginx itself?
>>>>
>>>> I am desperately find the answer everywhere. Please help me.
>>>>
>>>> Thank you
>>>>
>>>
>>>
>>>
>>> --
>>> Atenciosamente;
>>> Felipe Braz
>>> Linux User # 323052
>>>
>>
>>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready