Exclude specific location from cache

-----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-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sorry I forgot something, I’m using Nginx Plus R7.

nginx version: nginx/1.9.4 (nginx-plus-http2-r7-p1)
built by gcc 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --build=nginx-plus-http2-r7-p1

  • –prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx
  • –conf-path=/etc/nginx/nginx.conf
  • –error-log-path=/var/log/nginx/error.log
  • –http-log-path=/var/log/nginx/access.log
  • –pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock
  • –http-client-body-temp-path=/var/cache/nginx/client_temp
  • –http-proxy-temp-path=/var/cache/nginx/proxy_temp
  • –http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
  • –http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
  • –http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx
  • –group=nginx --with-http_ssl_module --with-http_v2_module
  • –with-http_realip_module --with-http_addition_module
  • –with-http_sub_module --with-http_dav_module --with-http_flv_module
  • –with-http_mp4_module --with-http_gzip_static_module
  • –with-http_gunzip_module --with-http_random_index_module
  • –with-http_secure_link_module --with-http_stub_status_module
  • –with-http_auth_request_module --with-mail --with-mail_ssl_module
  • –with-threads --with-file-aio --with-ipv6 --with-stream
  • –with-stream_ssl_module --with-http_f4f_module
  • –with-http_session_log_module --with-http_hls_module
  • –with-cc-opt=’-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
  • -fstack-protector-strong --param=ssp-buffer-size=4
  • -grecord-gcc-switches -m64 -mtune=generic’

On 12/24/2015 04:01 PM, Dewangga Bachrul Alam wrote:

$bypass; }
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

iQIcBAEBCAAGBQJWe7m5AAoJEOV/0iCgKM1w42YQAIor0QWCF6yiqM0Ea+Ek+LnU
BJUMe+bJecJsStV++S6QnfpaqcvDBr4hl5NzsgdG1eY3BX2rKWx6AGMMJAlrgTuI
eHSeb3Fvd7OBkGp0hr6+wkeeMfn/KsFL3kPwqqfS7KDAsH2z43Jzznj5XttFH+Vo
GcGHMDqUtLURWxepXpfFAWsfHWmv4MbD1pGksbLlBnYMS8wkIgn0+mUlTSkYTldi
SxWwtkRLDA2mQhw8vE99o3nmgpv26qTXJTX8+DgHOx3yhX364Ka8i4egSgrQO81a
oYT6HP07R6o63CdjY8b7aShG7IwtOMYf7NM3bn7eu/9dn8t/y0vzfRRtN9ZtHnsp
ejp8BiFkodOMclW27CQ2oMWIv7IJJuVV3q5IyVNFARYK1sGKM3GKWyiZLy+rLVGU
K3SUnvPO9dH1d9UyzvnzLf/bS7EwXhdPnPkOIiX1xdN/RJls8XJogLBNxqaF/mHo
ih0xTDvpLO6sYcEmSjECy1WZDoxmFbiL5pVi0sWD5unFoUuUk+XoFbrJCzi3tMTv
CWUZt1WbOxV3sgQRHbnH6ZyzYOFaAaLPBYgCWJR8uRXGTtn2ybSYhFLtkNxsjxgO
RqRYBptVbdRPbHb5AAU9YOh8Vi2ktMZCoX016pdLXvnm0l/ikYrf903e9wMO7DSB
9mCYvrrRShJqCRifm7GT
=z8GZ
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/24/15 12:24 PM, Dewangga Bachrul Alam wrote:

Sorry I forgot something, I’m using Nginx Plus R7.

[…]

Hi Dewangga,

please open a support ticket. Our engineers will help you with that
in a minute.


Maxim K.
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAlZ7uroACgkQ7PDpCywXIIPx1QCfUIaXwI705Ft/XWrfKfYOuCI+
EpcAoKq8XaXyAYTKDkgfPwSMb6G92fQP
=kLMV
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello!

On 12/24/2015 04:28 PM, Maxim K. wrote:

On 12/24/15 12:24 PM, Dewangga Bachrul Alam wrote:

Sorry I forgot something, I’m using Nginx Plus R7.

[…]

Hi Dewangga,

please open a support ticket. Our engineers will help you with
that in a minute.

Re-send to nginx-plus support :slight_smile:
Thank you Maxim.

[…]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWe79eAAoJEOV/0iCgKM1wPa0QAJxaOgqw5s8OOa+IgwFq7xc/
LitVKRHukMVxskkpzehliu7OZ6UVv2J1uiJ3z4ltbbQ3Cie/XiWkutI1F25ur45K
7aLjCml9X3gaiYQ75GlS0zdJQD9gR6YmvVdHbv8SggUWQYHz7cFgPwP9lSE3Bo/O
P7MEen8k3xYxkHK24B/jGg+DB+SH0s9mIChyhtqtbx0PkNsJbIHsQSB06Sle5I1E
nQB81x3FvzCEhQfJXgUlZDWJgMe8+aw64ooexBpcE/yxSiYZ0vZxkGQT3VZUKHYn
GdblSmLcQyWWqaId+5OXRMNVDQXfwIJAKLrfAQRG8KSiXp2yAgoTZrv4PC6lVcLa
RGAbhdf7z8sIisTlhDOaO0PGbdll2j08jQMARK6bdnd5ZxCv8JKZkhXimXUmt/4e
uN7r3f6jTcL4dr1RJ4V9QAsIeAhKUV8JJ+zrSfzd7Ts8Y7bzQeH2mvtziJKAA1yG
ZoYF6UoWe67HyCsoYRpMXMahmSnAp+3DiTc9C4I4AxeanJTbpxADu2W83LdxOb51
We4N8vdFcjRrYqnclT0QQKezZEkXT0inSPq1H/bN1MBo610cryOemnSbrSO+bmEt
vqzg8M3vNSsHL+wXEmAmOcwN6/7U4D5kRhno6gsLfg/aS45N3pmdj7RjIkoEDafb
0hI9g54DFT6CazqXGNBT
=LXxw
-----END PGP SIGNATURE-----