Welcome! Log In Create A New Profile

Advanced

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Francis Daly
October 25, 2011 06:12PM
On Wed, Oct 26, 2011 at 01:11:40AM +0400, Кирюшкин Владимир wrote:

Hi there,

> /etc/nginx/proxy.conf has such options among others:
>
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

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

> and I have patched latest thttpd (http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz) with this patch: http://wiki.nginx.org/ThttpdRealIP

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

> #!/bin/sh
> echo "Content-type: text/html; charset=UTF-8";
> echo;
> echo "i am cgi script<br><br>";
> echo "env: <br><br>";
> env
>

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

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

If they are what you expect, check what your patched thttpd is doing.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx and thttpd + cgi, remote_addr = 127.0.0.1

Кирюшкин Владимир October 25, 2011 05:12PM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Francis Daly October 25, 2011 06:12PM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Кирюшкин Владимир October 25, 2011 06:18PM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Aleksandar Lazic October 25, 2011 06:42PM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Francis Daly October 26, 2011 09:04AM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Кирюшкин Владимир October 26, 2011 10:34AM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Igor Sysoev October 26, 2011 10:28AM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Кирюшкин Владимир October 26, 2011 11:50AM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Aleksandar Lazic October 26, 2011 11:52AM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Кирюшкин Владимир October 26, 2011 04:38PM

Re: nginx and thttpd + cgi, remote_addr = 127.0.0.1

Aleksandar Lazic October 26, 2011 05:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready