Skip to content

Instantly share code, notes, and snippets.

@Hounddog
Created April 28, 2015 10:59
Show Gist options
  • Save Hounddog/2620a78e12de2f69443a to your computer and use it in GitHub Desktop.
Save Hounddog/2620a78e12de2f69443a to your computer and use it in GitHub Desktop.
nginx filter passzord
# Custom logstash format
log_format logstash '$http_host '
'$remote_addr [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$temp_request_body" '
'$request_time '
'$upstream_response_time';
server {
access_log /var/log/nginx/xxx-access.log logstash;
error_log /var/log/nginx/xxx-error.log;
server_name _;
root /var/www/xxx.com/current/src/public;
listen 80 default_server;
location / {
index index.php;
try_files $uri $uri/ /index.php$is_args$args;
#Strip password in access.log
set $temp_request_body $request_body;
# if ($temp_request_body ~ (.*)password=[^&]*(.*)) {
# set $temp_request_body $1password=****$2;
# }
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment