Welcome! Log In Create A New Profile

Advanced

Exclude specific location from cache

December 24, 2015 05:24PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello!

Currently my configuration looks like this :

map $request_method $purge_method {
PURGE 1;
default 0;
}

map $arg_geoloc $bypass {
default 1;
1 0;
}

# Exclude from cache
# Expected URL http://domain.tld/
location = / {
proxy_pass [..];
proxy_no_cache $bypass;
proxy_cache_bypass $bypass;
}

# Expected URL http://domain.tld/indeks/*
# Expected URL http://domain.tld/kanal/*
location ~ ^/(indeks|kanal)/ {
proxy_pass [..];
proxy_no_cache $bypass;
proxy_cache_bypass $bypass;
}

# The rest are cached
# Expected URL http://domain.tld/* (except the condition above)
location / {
proxy_pass [..];
proxy_cache my_cache;
proxy_cache_purge $purge_method;
proxy_cache_use_stale error timeout updating http_500 http_502
http_503 http_504;
proxy_cache_valid 200 206 302 1h;
proxy_cache_valid any 3s;
proxy_cache_lock on;
proxy_cache_revalidate on;
proxy_cache_min_uses 10;
}

My goal is, exclude the homepage, indeks and kanal pages, then cache
the rest URL. Am I right with the configuration above?

Any help and advice are appreciated.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWe7R/AAoJEOV/0iCgKM1w+o4P/RuZ3NJ1BiQ1B30kapHsAHhm
ylW7O8E0Qx5vLF8aR0BzI3TTTsHEva9jXOrHwOf1+CiT+z/07IBvhjqDHOKhKdr5
46kMM9m/7L5ZEmH+AWM/InDQWgVkvP1UEJkYNoOAGB/NkT+zVv7g+MvJEmcf/abP
BJxektr8j8NldhNx5QiSZswz2AChpg67wh/aWX0Q4vtytZOYn+1/lxMteQjrRBQa
Ub75uw5yiPIKLTABdEBUJV4ulI+yel8VD6o0LOc1xbt4MUh/31Vp8kN5YziOhOK8
DB5bvCdLTFHyu8Bv8sAEmhuPxJiJ9Y9oL/HHVp5NTkDqNle7Otnr/f25jxnSFcYK
9OLY5UbWw6We8nJMk1psKbVWXPMdUBnAIvdRfIMcgHHb7QFmxxBfoCLiN7Xpt60g
v4o7pGa5Oz/OVE/XdUT79uLE9vbRdFM8ZoXxkLa2mTPvUzndXuqyzgx+2GAlghb8
5te+y/aCskYAL9b/retRQrp/dBBe3TqY9Ni8CTuoZ+SgUOhk07aYIGB7Q7pEY5Sd
cauWrxT4ijthE/GOM3NP7lVEtq5Cz+XDb9n5V2PFqxYi1LsLix6sYCIYwnYkVAqV
E44MAuViVFpj+NULcriNnU3HNJB6OWQdoEcNXodHUwm71k8ctPUSBrQK5w6c42xP
R6qDdDpqFU0oKoooXRHG
=tzpt
-----END PGP SIGNATURE-----

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

Exclude specific location from cache

dewanggaba December 24, 2015 05:24PM

Re: Exclude specific location from cache

dewanggaba December 24, 2015 05:24PM

Re: Exclude specific location from cache

Maxim Konovalov December 24, 2015 05:24PM

Re: Exclude specific location from cache

dewanggaba December 24, 2015 05:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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