[BUG] incorrect server address passed to PHP through FastCGI(from nginx version 0.7.36)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[BUG] incorrect server address passed to PHP through FastCGI(from nginx version 0.7.36)

Kinch Zhang
Hi, there.

We're using nginx with PHP through FastCGI, and from nginx 0.7.36 on, the PHP
global variable $_SERVER["SERVER_ADDR"] is always 0.0.0.0, but with the same PHP
configuration, nginx 0.7.35 passed the correct server address, so I think
there's a bug in nginx 0.7.36+.

Regards,

Kinch Zhang


Reply | Threaded
Open this post in threaded view
|

Re: [BUG] incorrect server address passed to PHP through FastCGI(from nginx version 0.7.36)

Michael Shadle
i can validate this.

i was running 0.7.31, i just upgraded to 0.7.42, and it stopped
reporting the right variable.

it is being passed like so:
fastcgi_param SERVER_ADDR $server_addr;

so there is a bug somewhere.

On Mon, Mar 16, 2009 at 8:56 PM, Kinch Zhang <[hidden email]> wrote:

> Hi, there.
>
> We're using nginx with PHP through FastCGI, and from nginx 0.7.36 on, the PHP
> global variable $_SERVER["SERVER_ADDR"] is always 0.0.0.0, but with the same PHP
> configuration, nginx 0.7.35 passed the correct server address, so I think
> there's a bug in nginx 0.7.36+.
>
> Regards,
>
> Kinch Zhang
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [BUG] incorrect server address passed to PHP through FastCGI(from nginx version 0.7.36)

lhmwzy
so with me.
I am using 0.7.42 and php-fpm.

2009/3/17 mike <[hidden email]>:

> i can validate this.
>
> i was running 0.7.31, i just upgraded to 0.7.42, and it stopped
> reporting the right variable.
>
> it is being passed like so:
> fastcgi_param SERVER_ADDR $server_addr;
>
> so there is a bug somewhere.
>
> On Mon, Mar 16, 2009 at 8:56 PM, Kinch Zhang <[hidden email]> wrote:
>> Hi, there.
>>
>> We're using nginx with PHP through FastCGI, and from nginx 0.7.36 on, the PHP
>> global variable $_SERVER["SERVER_ADDR"] is always 0.0.0.0, but with the same PHP
>> configuration, nginx 0.7.35 passed the correct server address, so I think
>> there's a bug in nginx 0.7.36+.
>>
>> Regards,
>>
>> Kinch Zhang
>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [BUG] incorrect server address passed to PHP through FastCGI(from nginx version 0.7.36)

Igor Sysoev
In reply to this post by Kinch Zhang
On Tue, Mar 17, 2009 at 03:56:38AM +0000, Kinch Zhang wrote:

> We're using nginx with PHP through FastCGI, and from nginx 0.7.36 on, the PHP
> global variable $_SERVER["SERVER_ADDR"] is always 0.0.0.0, but with the same PHP
> configuration, nginx 0.7.35 passed the correct server address, so I think
> there's a bug in nginx 0.7.36+.

The attached patch should fix the bug.


--
Igor Sysoev
http://sysoev.ru/en/

patch.server_addr (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] incorrect server address passed to PHP through FastCGI(from nginx version 0.7.36)

Cliff Wells
On Tue, 2009-03-17 at 23:00 +0300, Igor Sysoev wrote:
> On Tue, Mar 17, 2009 at 03:56:38AM +0000, Kinch Zhang wrote:
>
> > We're using nginx with PHP through FastCGI, and from nginx 0.7.36 on, the PHP
> > global variable $_SERVER["SERVER_ADDR"] is always 0.0.0.0, but with the same PHP
> > configuration, nginx 0.7.35 passed the correct server address, so I think
> > there's a bug in nginx 0.7.36+.
>
> The attached patch should fix the bug.
>

Works for me.

Cliff


Reply | Threaded
Open this post in threaded view
|

Re: [BUG] incorrect server address passed to PHP through FastCGI(from nginx version 0.7.36)

lhmwzy
works fine for me too.

2009/3/18 Cliff Wells <[hidden email]>:

> On Tue, 2009-03-17 at 23:00 +0300, Igor Sysoev wrote:
>> On Tue, Mar 17, 2009 at 03:56:38AM +0000, Kinch Zhang wrote:
>>
>> > We're using nginx with PHP through FastCGI, and from nginx 0.7.36 on, the PHP
>> > global variable $_SERVER["SERVER_ADDR"] is always 0.0.0.0, but with the same PHP
>> > configuration, nginx 0.7.35 passed the correct server address, so I think
>> > there's a bug in nginx 0.7.36+.
>>
>> The attached patch should fix the bug.
>>
>
> Works for me.
>
> Cliff
>
>
>