Welcome! Log In Create A New Profile

Advanced

Map is not matching correctly against upstream custom header

Gabriel Arrais
June 02, 2016 01:52PM
Hi, I'm trying to configure my proxy cache settings based in a response
custom
header, using proxy_no_cache and proxy_cache_bypass directives.

First question: is it possible at all?
Second question: If it is, why this map is always hitting the default
value?

map $sent_http_x_my_custom_header $no_cache {
default 0;
1 0;
true 0;
false 1;
"~*false" 1;
}

....

location ~ ^/ {
...
proxy_no_cache $no_cache;^M
proxy_cache_bypass $no_cache;^M
}

I've already tried the map with $sent_http_x_my_custom_header,
$upstream_http_x_my_custom_header and $http_x_my_custom_header. It's
always the same result.

obs: I've already tried with if but if is resolved in request time so it
didn't work.

Thank you in advance.

--
Posted via http://www.ruby-forum.com/.

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

Map is not matching correctly against upstream custom header

Gabriel Arrais June 02, 2016 01:52PM

Re: Map is not matching correctly against upstream custom header

Maxim Dounin June 02, 2016 02:36PM

Re: Map is not matching correctly against upstream custom header

Gabriel Arrais June 02, 2016 03:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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