Welcome! Log In Create A New Profile

Advanced

Conditional access log formatting ?

Ben
July 18, 2015 06:38AM
Hi,

I'm using haproxy infront of some NGINX instances, but only for some
instances which are being loadbalanced by haproxy, there are other
instances which go straight through.

I realise I need to change the logging format in NGINX to enable
X-Forwarded-For in the access logs.

The question is whether I can conditionally format the logs, i.e. use
"X-Forwarded-For" if it exists, otherwise use the normal NGINX logging
format.

I've had a quick peek at the manual, I'm thinking maybe this can be done
with a map of some sort ? Maybe there's a better way ? To be honest
I've no idea where to start, and I've never used maps before anyway !

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

Conditional access log formatting ?

Ben July 18, 2015 06:38AM

Re: Conditional access log formatting ?

B.R. July 18, 2015 02:04PM

Re: Conditional access log formatting ?

Valentin V. Bartenev July 20, 2015 08:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 243
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