9 messages in ru.sysoev.nginxRe: Via header
FromSent OnAttachments
Jason BJan 23, 2007 10:04 pm 
Igor SysoevJan 23, 2007 10:21 pm 
Jason BJan 23, 2007 10:42 pm 
Jonathan VanascoJan 24, 2007 12:08 am 
Igor SysoevJan 24, 2007 12:20 am 
Jonathan VanascoJan 24, 2007 12:51 am 
Ian EvansJan 26, 2007 2:11 am 
Igor SysoevJan 26, 2007 4:17 am 
Ian EvansJan 26, 2007 8:35 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Via headerActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Jan 26, 2007 4:17:30 am
List:ru.sysoev.nginx

On Fri, 26 Jan 2007, Ian Evans wrote:

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?

nginx currently has no $proxy_add_via variable similar to $proxy_add_x_forwarded_for, that would allow set Via using simple

proxy_set_header Via $proxy_add_via;

However, you may use the following configuration:

location / {

set $via "1.0 your.host"; if ($http_via) { set $via "$http_via, 1.0 your.host"; }

proxy_set_header Via $via;