sp-containers/files/common/nginx/nginx.conf.gotmpl

50 lines
1.7 KiB
Go Template
Raw Normal View History

2023-06-05 15:24:42 +02:00
# user www-data;
pid /tmp/nginx.pid;
worker_processes auto;
daemon off;
events {
worker_connections {{ env.Getenv "NGINX_EVENTS_WORKER_CONNECTIONS" "1024" }};
}
http {
charset {{ env.Getenv "NGINX_CHARSET" "utf-8" }};
# copies data between one FD and other from within the kernel
# faster than read() + write()
sendfile {{ env.Getenv "NGINX_SENDFILE" "on" }};
# send headers in one piece, it is better than sending them one by one
tcp_nopush {{ env.Getenv "NGINX_TCP_NOPUSH" "on" }};
# don't buffer data sent, good for small data bursts in real time
tcp_nodelay {{ env.Getenv "NGINX_TCP_NODELAY" "on" }};
# allow the server to close connection on non responding client, this will free up memory
reset_timedout_connection {{ env.Getenv "NGINX_RESET_TIMEDOUT_CONNECTION" "on" }};
# hide server info for security
server_tokens {{ env.Getenv "NGINX_SERVER_TOKENS" "off" }};
log_not_found {{ env.Getenv "NGINX_LOG_NOT_FOUND" "off" }};
types_hash_max_size 2048;
# if the request body size is more than the buffer size, then the entire (or partial)
# request body is written into a temporary file
client_body_buffer_size 128k;
# maximum body size
client_max_body_size {{ env.Getenv "NGINX_CLIENT_MAX_BODY_SIZE" "16M" }};
# maximum number and size of buffers for large headers to read from client request
large_client_header_buffers 4 256k;
# cache information about FDs, frequently accessed files
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 5;
open_file_cache_errors off;
# load configs
include /etc/nginx/conf.d/*.conf;
}