Search code examples
node.jscachingnginxhsts

Force HTST cache reset from webserver


I'm using nginx as reverse proxy and nodejs for the application. I want to know is there any solutions to force HSTS or HTTPS Strict Transport Security from webserver?

I don't want to ask users to reset their browser cache because its really technical and they don't know how to address this issue.


Solution

  • You can use max-age = 0 to reset cache and force HTST cache reset.

    In nginx:

    server {
       ...
       add_header  Strict-Transport-Security "max-age=0;";
       ...
    }