0

I try to create a microcaching in Nginx by configuring that only valid for the subpath of some URI that will work. For example :

https://example.com/path/anotherpath/view/ --> Will be cached https://example.com/path/anotherpath/view/subview --> not to be cached

I have tried this but it does not come out with luck

if ($uri ~* "/path/anotherpath/[^]+/[^]+") {set $no_cache "1";}

And this:

location ~* "/path/anotherpath/[^]+/[\d]" {set $no_cache "1";}

If you guys have any suggestions, they will be much appreciated.

navotera
  • 101
  • 5

1 Answers1

0

I manage to fix it by this config :

if ($uri ~* "/path/subpath/(.*)/(.*)$" ) { set  $no_cache "1";}
navotera
  • 101
  • 5