Welcome! Log In Create A New Profile

Advanced

Re: Nginx Map how to check value if empty

Francis Daly
March 04, 2017 03:16AM
On Fri, Mar 03, 2017 at 10:47:26AM -0500, c0nw0nk wrote:

Hi there,

> map $http_cf_connecting_ip $client_ip_from_cf {
> default $http_cf_connecting_ip;
> }
>
> How can I make it so if the client did not send that $http_ header it makes
> $client_ip_from_cf variable value = $binary_remote_addr
>
> Not sure how to check in a map if that http header is present.

If the http header is absent, the matching variable is empty. So it will
have the value "".

Use that as the first half of your "map" pair.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx Map how to check value if empty

c0nw0nk March 03, 2017 10:47AM

Re: Nginx Map how to check value if empty

Francis Daly March 04, 2017 03:16AM

Re: Nginx Map how to check value if empty

c0nw0nk March 04, 2017 05:35PM

Re: Nginx Map how to check value if empty

c0nw0nk March 05, 2017 04:00PM

Re: Nginx Map how to check value if empty

B.R. via nginx March 05, 2017 04:40PM

Re: Nginx Map how to check value if empty

c0nw0nk March 05, 2017 04:50PM

Re: Nginx Map how to check value if empty

B.R. via nginx March 06, 2017 07:04AM

Re: Nginx Map how to check value if empty

c0nw0nk March 06, 2017 02:12PM

Re: Nginx Map how to check value if empty

Francis Daly March 07, 2017 04:26PM

Re: Nginx Map how to check value if empty

c0nw0nk March 07, 2017 06:44PM

Re: Nginx Map how to check value if empty

c0nw0nk March 08, 2017 01:56AM

Re: Nginx Map how to check value if empty

B.R. via nginx March 08, 2017 04:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 91
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready