Enabled caching in nginx:
location ~* ^.+\.(js|css|png)$ { expires max; } Everything is working. Then there was a problem: unauthorized users on the site redirects to the main page, and after logging in, the user gets access to all pages. The strangest thing is that the browser (Chrome, if it matters) caches the redirection header. As a result, when I try to open that very page, I see status code 302 Moved Temporarily (from cache) . The same happens with successfully loaded pages - status code for some 200 ok (from cache) . How to force the browser to cache only js, css and png, but not to cache pages?