nginx and thttpd + cgi, remote_addr = 127.0.0.1

Кирюшкин Владимир vk at jasystem.net
Tue Oct 25 22:17:37 UTC 2011


Hello,

thanks for your answer.

26.10.2011, 02:10, "Francis Daly" <francis at daoine.org>:
> On Wed, Oct 26, 2011 at 01:11:40AM +0400, Кирюшкин Владимир wrote:

> That should cause two variables HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR
> to be visible in the CGI output.

alas, no. the full output is (when using proxy):

i am cgi script<br><br>
env: <br><br>
GATEWAY_INTERFACE=CGI/1.1
REMOTE_ADDR=127.0.0.1
HTTP_USER_AGENT=Opera/9.80 (X11; Linux i686; U; ru) Presto/2.9.168 Version/11.51
CGI_PATTERN=**.cgi|**.pl
HTTP_ACCEPT=text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
HTTP_HOST=***hidden***
SERVER_SOFTWARE=thttpd/2.25b 29dec2003
PATH=/usr/local/bin:/usr/ucb:/bin:/usr/bin
HTTP_ACCEPT_LANGUAGE=ru, en
SERVER_PROTOCOL=HTTP/1.0
REQUEST_METHOD=GET
PWD=/var/www/default
SERVER_PORT=8000
SCRIPT_NAME=/index.cgi
SERVER_NAME=127.0.0.1

> That patch looks like it will write the value of the X-Forwarded-For
> header into something internal to thttpd.

yes, it is intended to change X-Forwarded-For into Remote-Addr, but seems that it doesn't work.


> What are HTTP_X_REAL_IP and HTTP_X_FORWARDED_FOR in the output of this
> cgi script?

there are no such vars at all.

> If they are not what you expect, check what nginx is doing.

how could i do that?


Cheers,

Vladimir



More information about the nginx mailing list