Via header

Ian Evans ianevans at digitalhit.com
Fri Jan 26 13:12:18 MSK 2007


Greetings.

Using nginx to reverse proxy dynamic calls to Apache.

Been having a problem with the phpAdsNew software not always logging the
real IP, which therefore affects geotargetting. Some IPs are being logged
properly (nginx is sending the HTTP_X_FORWARDED_FOR and HTTP_X_REAL_IP
headers) but many are being logged as 127.0.0.1

I spoke to the phpAdsNew developers and they said:

"Since Openads proxy lookup feature wasn't created to deal with reverse
proxies it expects either a "Via" header (HTTP_VIA) or a reloved host
containing "cache", "proxy" or "inktomi"."

They asked me if I could ad the Via: header to the proxy. They said:

"So, the headers should look like:

GET ....
...
Via: 1.1 your-proxy
X-Forwarded-For: your-real-ip


>From RFC 2068:

QUOTE
14.44 Via

The Via general-header field MUST be used by gateways and proxies to
indicate the intermediate protocols and recipients between the user
agent and the server on requests, and between the origin server and
the client on responses. It is analogous to the "Received" field of
RFC 822 and is intended to be used for tracking message forwards,
avoiding request loops, and identifying the protocol capabilities of
all senders along the request/response chain."

So, is there anything I can do to add the Via header through nginx?






More information about the nginx mailing list