Created
November 13, 2014 18:40
-
-
Save lrvick/ff23ccf32c9703b86b5b to your computer and use it in GitHub Desktop.
Convert specific GET params to Cookies with NGINX.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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