Welcome! Log In Create A New Profile


Re[2]: Log $http_x_forwarded_for behind Cisco ACE LB

March 02, 2012 07:56AM
02 марта 2012, 15:01 от Edho Arief <edho@myconan.net>:
> 2012/3/2 Tib1 <nginx-forum@nginx.us>:
> > Hello !
> >
> > I'm new to Nginx.
> >
> > I installed Nginx (on Gentoo) instead of Apache behind a Cisco
> > LoadBalancer.
> >
> > My problem is that the directive $http_x_forwarded_for always write
> > local IP of the LoadBalancer instead of Real IP.
> >
> > But I have the good IP in the header HTTP_X_FORWARD.
> >
> perhaps something like this:
> set_real_ip_from load_balancer_ip;
> real_ip_header X-Forwarded-For;

Replace X-Forwarded-For with X-Forward and that shouldl work.

You may want to update your Cisco ACE loadbalancing policy
map configuration to insert the standard X-Forwarded-For
instead of the X-Forward header by doing something like this
in Exec mode:

host1/Admin# show running-config policy-map

You should see something like this:

policy-map type loadbalance http first-match L7_LB_POLICY
class L7_LB_CLASS
serverfarm SERVER_FARM_1
insert-http x-forward header-value "%is"

Then just replace the header:

Host1/Admin# configure terminal
Host1/Admin(config)# policy-map type loadbalance first-match L7_LB_POLICY
host1/Admin(config-pmap-lb)# class L7_LB_CLASS
host1/Admin(config-pmap-lb-c)# no insert-http X-Forward header-value "%is"
host1/Admin(config-pmap-lb-c)# insert-http X-Forwarded-For header-value "%is"
host1/Admin(config-pmap-lb-c)# exit
host1/Admin(config)# exit

If everything works as expected just save your configuration and that's it:
host1/Admin# copy running-config startup-config

nginx mailing list
Subject Author Posted

Re[2]: Log $http_x_forwarded_for behind Cisco ACE LB

Max March 02, 2012 07:56AM

Re: Re[2]: Log $http_x_forwarded_for behind Cisco ACE LB

Tib1 March 02, 2012 11:49AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 155
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 466 on July 09, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready