104 lines
3 KiB
Nginx Configuration File
104 lines
3 KiB
Nginx Configuration File
worker_processes auto;
|
|
worker_rlimit_nofile 65535;
|
|
pid /run/openresty.pid;
|
|
error_log /var/log/nginx/error.log debug;
|
|
|
|
# include modules/*.conf;
|
|
#load_module /usr/lib/nginx/modules/ngx_http_brotli_filter_module.so; # for compressing responses on-the-fly
|
|
#load_module /usr/lib/nginx/modules/ngx_http_brotli_static_module.so; # for serving pre-compressed files
|
|
#load_module /usr/lib/nginx/modules/ngx_http_headers_more_filter_module.so; # To add headers to any location without the nginx bullshit
|
|
#load_module /usr/lib/nginx/modules/ngx_http_zstd_filter_module.so; # for compressing responses on-the-fly
|
|
#load_module /usr/lib/nginx/modules/ngx_http_zstd_static_module.so; # for serving pre-compressed files
|
|
#load_module /usr/lib/nginx/modules/ngx_http_lua_module.so; # ngx_lua
|
|
#load_module /usr/lib/nginx/modules/ngx_http_lua_module.so
|
|
|
|
quic_bpf on;
|
|
|
|
events {
|
|
worker_connections 4096;
|
|
multi_accept on;
|
|
use epoll;
|
|
}
|
|
|
|
#resolver 127.0.0.1;
|
|
|
|
http {
|
|
map $server_addr $unix {
|
|
default 0;
|
|
"~unix:" 1;
|
|
}
|
|
|
|
include configs/cache.conf;
|
|
|
|
lua_package_path '/etc/openresty/lua/plugins/crowdsec/?.lua;/etc/openresty/lua/?.lua;/etc/openresty/lua/?/?.lua;;';
|
|
lua_package_cpath '/usr/lib/lua/5.1/?.so;;';
|
|
lua_shared_dict crowdsec_cache 128m;
|
|
lua_socket_pool_size 1024;
|
|
resolver 127.0.0.1 ipv6=off;
|
|
lua_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
|
|
init_by_lua_file "conf/lua/init.lua";
|
|
|
|
include configs/crowdsec.conf;
|
|
|
|
log_format limited '$remote_addr - $remote_user [$time_local] '
|
|
'"$request_method /bogus $server_protocol" $status $body_bytes_sent '
|
|
'"-" "Bogus/66.6" - "$http_host"';
|
|
|
|
access_log off;
|
|
error_log /dev/null;
|
|
#error_log /var/log/nginx/error.log debug;
|
|
|
|
# Basic Settings
|
|
charset utf-8;
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
server_tokens off;
|
|
log_not_found off;
|
|
types_hash_max_size 1024;
|
|
types_hash_bucket_size 128;
|
|
server_names_hash_bucket_size 128;
|
|
|
|
# MIME
|
|
include mime.types;
|
|
|
|
# SSL
|
|
include configs/ssl.conf;
|
|
|
|
# reset timed out connections freeing ram
|
|
reset_timedout_connection on;
|
|
# maximum time between packets the client can pause when sending nginx any data
|
|
client_body_timeout 10s;
|
|
# maximum time the client has to send the entire header to nginx
|
|
client_header_timeout 10s;
|
|
# timeout which a single keep-alive client connection will stay open
|
|
keepalive_timeout 60s;
|
|
# maximum time between packets nginx is allowed to pause when sending the client data
|
|
send_timeout 10s;
|
|
|
|
client_body_buffer_size 32k;
|
|
client_max_body_size 2m;
|
|
|
|
# open_file_cache max=1024 inactive=10s;
|
|
# open_file_cache_valid 60s;
|
|
# open_file_cache_min_uses 2;
|
|
# open_file_cache_errors on;
|
|
|
|
# PERFORMANCE / ASYNC I/O
|
|
#aio threads=default;
|
|
#aio_write on;
|
|
#directio 2m;
|
|
|
|
# QUIC settings
|
|
# https://nginx.org/en/docs/http/ngx_http_v3_module.html
|
|
quic_gso on;
|
|
|
|
# Maps
|
|
include snippets/maps.conf;
|
|
#include snippets/poop.conf;
|
|
|
|
include configs/general.conf;
|
|
include configs/upstreams.conf;
|
|
include configs/limits.conf;
|
|
include http.d/*.conf;
|
|
}
|