Welcome! Log In Create A New Profile

Advanced

Re: Bad default for proxy_cache_key

Maxim Dounin
June 30, 2014 07:50PM
Hello!

On Sun, Jun 29, 2014 at 06:15:56PM -0300, Bráulio Bhavamitra wrote:

> Hello all,
>
> I stucked a while with a config problem where proxy_cache_key default value
> was $scheme$proxy_host$uri$is_args$args".
>
> Then I realized it really didn't make. A better value
> $scheme$host$uri$is_args$args" is much more reasonable, as the reverse
> proxy requests comes from many server {} with multiple server name and
> aliases.
>
> Shouldn't the default be changed?

The default key is to identify resources nginx requests from
upstream servers. That is, these are the same:

server {
server_name bar;

location / {
proxy_pass http://foo.example.com;
}
}

server {
server_name bazz;

location / {
proxy_pass http://foo.example.com;
}
}

While these are different:


server {
server_name foo;

location / {
set $backend "foo.example.com";

if ($user_is_admin) {
set $backend "admin.example.com";
}

proxy_pass http://$backed;
}
}


If in your case multiple such resources are equal or different
based on other factors (likely, due to "proxy_set_header Host ..."
in your configuration), you are free to change proxy_cache_key
accordingly.

--
Maxim Dounin
http://nginx.org/

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

Bad default for proxy_cache_key

Bráulio Bhavamitra June 29, 2014 05:18PM

Re: Bad default for proxy_cache_key

Maxim Dounin June 30, 2014 07:50PM

Re: Bad default for proxy_cache_key

Bráulio Bhavamitra July 29, 2014 03:52PM

Re: Bad default for proxy_cache_key

Maxim Dounin July 29, 2014 07:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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