Hide a request cookie in proxy_pass

gthb nginx-forum at nginx.us
Tue Sep 2 10:16:42 UTC 2014

Yep, works like a charm, thank you! And two consecutive ifs to strip two
cookies works as well:

    set $stripped_cookie $http_cookie;
    if ($http_cookie ~ "(.*)(?:^|;)\s*sessionid=[^;]+(.*)$") {
        set $stripped_cookie $1$2;
    if ($stripped_cookie ~ "(.*)(?:^|;)\s*csrftoken=[^;]+(.*)$") {
        set $stripped_cookie $1$2;



Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252944,253012#msg-253012

More information about the nginx mailing list