Skip to content

Instantly share code, notes, and snippets.

@alex-popov-tech
Created November 12, 2018 22:16
Show Gist options
  • Save alex-popov-tech/e2d308c5500476a6a197d975d438bee1 to your computer and use it in GitHub Desktop.
Save alex-popov-tech/e2d308c5500476a6a197d975d438bee1 to your computer and use it in GitHub Desktop.
# user www-data;
# worker_processes auto;
# pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
include /etc/nginx/mime.types;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
log_format postdata '$remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent" $request_time req_body:"$request_body"';
map $request_body $matched {
"~.*true.*" "1";
default "";
}
server {
location ~ /$ {
echo_read_request_body;
access_log /var/log/nginx/access.log postdata;
if ($matched) { return 503; }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment