Created
November 23, 2017 03:01
-
-
Save nandiheath/03927f9ec7d15a49c9671d9302c1cfdf to your computer and use it in GitHub Desktop.
nginx configuration that escape the request body and logging important information
This file contains hidden or 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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 10000; | |
} | |
worker_rlimit_nofile 40000; | |
http { | |
log_format main escape=json '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for" ' | |
'"$request_body"'; | |
access_log /var/log/nginx/access.log main; | |
keepalive_timeout 65; | |
keepalive_requests 10000; | |
client_max_body_size 20M; | |
include /etc/nginx/conf.d/*.conf; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment