Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created November 13, 2014 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrvick/ff23ccf32c9703b86b5b to your computer and use it in GitHub Desktop.
Save lrvick/ff23ccf32c9703b86b5b to your computer and use it in GitHub Desktop.
Convert specific GET params to Cookies with NGINX.
# Convert GET access_token to Cookie to avoid Referrer leaks.
location / {
if ($request_uri ~ (.*[\?&])access_token=[^&]*&?(.*)){
add_header Set-Cookie access_token=$arg_access_token;secure;HttpOnly
return 301 $1$2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment