Last active
December 15, 2015 23:59
-
-
Save avar/5344282 to your computer and use it in GitHub Desktop.
Non-working example of clobbering credit card numbers in nginx.conf
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
http { | |
include mime.types; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request_munged" ' | |
'$status $body_bytes_sent $request_time/$upstream_response_time ' | |
'"$http_referer" "$http_user_agent"'; | |
[...] | |
server { | |
location / { | |
# The original request | |
set $request_munged $request; | |
# Strip some secret data out before logging it | |
if ($request_munged ~ /^(.*?&credit_card_number=)[^&]+(.*?)$/) { | |
set $request_munged "$1SEEKRT$2"; | |
} | |
uwsgi_pass unix:/var/run/uwsgi/uwsgi.sock; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment