I configure NGINX proxy cache for Atlassian Confluence
And i faced a problem of caching the edited pages
Some time after editing the pages do not show the changes(cache TTL)
I decided to force the clearing of NGINX cache after pressing the "Save" button
For that i used LUA script:
location ~ /pages/editpage.action?pageId=87556693 {
content_by_lua 'os.execute("find /var/cache/nginx/ -type f -delete")';
return 302 $scheme://example.com$request_uri;
}
But a got cycle redirections (obviously :)
I have 2 questions:
How to change
location ~ /pages/editpage.action?pageId=87556693
for dynamic url (numbers87556693
can change)?How to rewrite url
/pages/editpage.action?pageId=87556693
to/pages/viewpage.action?pageId=87556693
inlocation
in NGINX? To get rid of cycle redirections
Im not good at regex
Thanks!
?
was URL-encoded as%3F
as per the stackoverflow.com/questions/20470191/… :-)