Last active 1747770907

nginx.conf Raw
1user www-data;
2worker_processes auto;
3worker_cpu_affinity auto;
4pid /run/nginx.pid;
5include /etc/nginx/modules-enabled/*.conf;
6
7worker_rlimit_nofile 409600;
8events {
9 use epoll;
10 worker_connections 204800;
11 multi_accept on;
12}
13
14http {
15
16 open_file_cache max=200000 inactive=20s;
17 open_file_cache_valid 30s;
18 open_file_cache_min_uses 2;
19 open_file_cache_errors on;
20
21 ##
22 # Basic Settings
23 ##
24
25 sendfile on;
26 tcp_nopush on;
27 tcp_nodelay on;
28 keepalive_timeout 65;
29 types_hash_max_size 2048;
30 server_tokens off;
31 client_max_body_size 100m;
32
33 server_names_hash_bucket_size 64;
34 server_name_in_redirect off;
35
36 variables_hash_max_size 2048;
37
38 include /etc/nginx/mime.types;
39 default_type application/octet-stream;
40
41 ##
42 # Logging Settings
43 ##
44
45 access_log /var/log/nginx/access.log;
46 error_log /var/log/nginx/error.log;
47
48 ##
49 # Gzip Settings
50 ##
51
52 gzip on;
53 gzip_disable "msie6";
54
55 gzip_vary on;
56 gzip_proxied any;
57 gzip_comp_level 6;
58 gzip_buffers 16 8k;
59 gzip_http_version 1.1;
60 gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
61
62 #Brotli Compression
63 brotli on;
64 brotli_comp_level 6;
65 brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
66
67 ##
68 # Nginx Cache Settings
69 ##
70
71# proxy_temp_file_write_size 128k;
72# proxy_temp_path /mnt/cache/nginx/cache/temp;
73# proxy_cache_path /mnt/cache/nginx/cache/cache_1 levels=1:2 keys_zone=cache_1:50m inactive=30d max_size=450g;
74# proxy_cache_path /mnt/cache/nginx/cache/cache_2 levels=1:2 keys_zone=cache_2:50m inactive=30d max_size=450g;
75# proxy_cache_path /mnt/cache/nginx/cache/cache_3 levels=1:2 keys_zone=cache_3:50m inactive=30d max_size=450g;
76# proxy_cache_path /mnt/cache/nginx/cache/cache_4 levels=1:2 keys_zone=cache_4:50m inactive=30d max_size=450g;
77# proxy_cache_path /mnt/cache/nginx/cache/cache_5 levels=1:2 keys_zone=cache_5:50m inactive=30d max_size=450g;
78
79 ##
80 # Rate limiting
81 #
82 limit_req_zone $binary_remote_addr zone=limit_1:50m rate=5r/s;
83
84 ##
85 # nginx-naxsi config
86 ##
87 # Uncomment it if you installed nginx-naxsi
88 ##
89
90 #include /etc/nginx/naxsi_core.rules;
91
92 ##
93 # Virtual Host Configs
94 ##
95
96 http2 on;
97
98 include /etc/nginx/conf.d/*.conf;
99 include /etc/nginx/sites-enabled/*;
100}
101
102