Nginx cookie map regex remove + character

Francis Daly francis at
Sat Apr 1 11:57:28 UTC 2017

On Fri, Mar 24, 2017 at 05:18:23PM -0400, c0nw0nk wrote:

Hi there,

> The cookie name = a MD5 sum the full / complete value of the cookie seems to
> cut of at a plus + symbol

Your regex piece is


which says to match one or more \w characters ({1,}), one or more times (+)

\w is "word character", which is alnum-or-underscore.

> What would the correct regex to be to ignore / remove + symbols from
> "session_value"

If you want to match "word character or plus", use something like [\w+].

And then also probably remove one of "{1,}" and "+", since they mean
the same thing and having both is redundant.

Francis Daly        francis at

More information about the nginx mailing list