4chan/conf/nginx.conf
2025-04-17 18:12:08 -05:00

74 lines
1.8 KiB
Nginx Configuration File

#nginx.conf for ayase
pid /var/run/nginx.pid;
user www www;
worker_processes 16;
worker_priority -2;
worker_rlimit_nofile 1572023;
timer_resolution 100ms;
pcre_jit on;
events {
use kqueue;
multi_accept on;
accept_mutex on;
worker_connections 1414818;
#debug_connection 50.156.113.198;
}
http {
include mime.types.nginx;
default_type application/octet-stream;
server_tokens off;
more_set_headers 'Server: nginx';
error_log /www/logs/nginx_error_log notice;
log_not_found off;
#aio sendfile;
sendfile on; #does not work with tmpfs, turned off there
#timeouts
client_header_timeout 4;
client_body_timeout 10; #was 10
keepalive_timeout 15;
send_timeout 10;
reset_timedout_connection on;
#buffer sizes
client_body_buffer_size 128k; #higher because we allow uploads
client_header_buffer_size 1k;
client_max_body_size 20m; #higher because we allow uploads
large_client_header_buffers 2 8k;
http2_max_field_size 8k;
http2_max_header_size 32k;
client_body_temp_path /www/tmpfs 1; #store uploads on tmpfs
# some SSL stuff, the rest goes in nginx_ssl.inc
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:128m;
ssl_session_timeout 24h;
map $scheme $php_https { https on; http off; }
server_names_hash_bucket_size 64;
ignore_invalid_headers on;
open_file_cache max=32768;
open_file_cache_min_uses 10;
open_file_cache_valid 10s;
open_file_cache_errors on;
gzip on;
gzip_static on;
gzip_buffers 32 4k;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/rss+xml application/javascript application/x-javascript application/json application/pdf image/x-icon image/bmp image/svg+xml;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
#geo
geoip_country /usr/local/share/GeoIP/GeoIP.dat;
include /www/conf/site/*.nginx.conf;
}