Solution to the problem of nginx caching a page after a string session

  • 2020-05-06 12:16:40
  • OfStack

nginx supports page caching. I introduced the configuration scheme on my blog before. Yesterday, there was a weird problem.

After checking, nginx also caches the header information of the response page, including Set-cookie, resulting in the cookie of the user accessing the page later being set as the header of the cache.
The solution, nginx, provides instructions for proxy_hide_header that remove the relevant response header information:

proxy_hide_header Set-Cookie;

Conclusion: with configuration, the problem of string sessions no longer occurs

Related articles: