misfoc.us

  • Archive
  • RSS
  • Ask me anything

Cookie Cleaning with Nginx

A few days ago, we discovered that there was some odd behavior with some traffic hitting our sites due to a cookie with a null name. It was causing some weirdness with our application and causing our alerting software to freak out. I was tasked with coming up with a solution to handling this. I dabble in the load balancing space and decided to solve this by stripping out the cookie in Nginx.

set $cookies $http_COOKIE;
if ($http_COOKIE ~* "(.*;)\s=deleted;(.*)") {
    set $cookies $1$2;
}
proxy_set_header cookie $cookies;
    • #nginx
    • #opensource
    • #tips
  • 1 year ago
  • 5
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

About

A place for me to post about things that interest me. If you stick around, you might find something interesting!

Me, Elsewhere

  • @landrysplace on Twitter
  • adalan420 on Youtube
  • adalan on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union