Skip to content

Instantly share code, notes, and snippets.

@johnhpatton
Last active December 13, 2021 11:15
Show Gist options
  • Save johnhpatton/420bedf58ed10be50bf05ef3fbd0cabb to your computer and use it in GitHub Desktop.
Save johnhpatton/420bedf58ed10be50bf05ef3fbd0cabb to your computer and use it in GitHub Desktop.
Nginx + Lua to mitigate CVE-2021-44228
# /etc/nginx/nginx.conf
# nginx plus implementation for RHEL hosts
load_module modules/ndk_http_module.so;
load_module modules/ngx_http_lua_module.so;
error_log /var/log/nginx/error.log error;
pid /var/run/nginx.pid;
lock_file /var/lock/nginx.lock;
worker_processes auto;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'"$cve_2021_44228_log"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment