@@ -22,19 +22,19 @@ http {
2222 client_body_timeout 180s ;
2323 client_header_buffer_size 2k ;
2424 client_body_buffer_size 256k ;
25- client_max_body_size 256m ;
25+ client_max_body_size 1024m ;
2626 large_client_header_buffers 4 8k ;
2727 send_timeout 60s ;
2828 keepalive_timeout 30s ;
29- keepalive_requests 100000 ;
29+ keepalive_requests 10000 ;
3030 reset_timedout_connection on;
3131 server_tokens off;
3232 server_name_in_redirect off;
3333 server_names_hash_max_size 512 ;
3434 server_names_hash_bucket_size 512 ;
3535 charset utf-8;
3636 # FastCGI settings
37- fastcgi_buffers 8 256k ;
37+ fastcgi_buffers 512 4k ;
3838 fastcgi_buffer_size 256k ;
3939 fastcgi_busy_buffers_size 256k ;
4040 fastcgi_temp_file_write_size 256k ;
@@ -51,14 +51,15 @@ http {
5151 proxy_set_header X-Real-IP $remote_addr ;
5252 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
5353 proxy_pass_header Set-Cookie;
54- proxy_buffers 32 4k ;
55- proxy_buffer_size 8k ;
54+ proxy_buffers 256 4k ;
55+ proxy_buffer_size 32k ;
56+ proxy_busy_buffers_size 32k ;
57+ proxy_temp_file_write_size 256k ;
5658 proxy_connect_timeout 30s ;
5759 proxy_read_timeout 300s ;
5860 proxy_send_timeout 180s ;
5961 # Log format
60- log_format main '$remote_addr - $remote_user [$time_local] $request '
61- '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' ;
62+ log_format main '$remote_addr - $remote_user [$time_local] $request "$status" $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"' ;
6263 log_format bytes '$body_bytes_sent' ;
6364 log_not_found off;
6465 access_log off;
@@ -67,53 +68,46 @@ http {
6768 default_type application/octet-stream ;
6869 # Compression
6970 gzip on;
70- gzip_static on;
7171 gzip_vary on;
72+ gzip_static on;
7273 gzip_comp_level 6;
7374 gzip_min_length 1024 ;
74- gzip_buffers 16 8k ;
75+ gzip_buffers 128 4k ;
7576 gzip_http_version 1.1;
76- gzip_types text/plain text/css text/javascript text/js text/xml
77- application/json application/javascript application/x-javascript application/xml
78- application/xml+rss application/x-font-ttf image/svg+xml font/opentype;
77+ gzip_types text/css text/javascript text/js text/plain text/richtext text/shtml text/x-component text/x-java-source text/x-markdown text/x-script text/xml image/bmp image/svg+xml image/vnd.microsoft.icon image/x-icon font/otf font/ttf font/x-woff multipart/bag multipart/mixed application/eot application/font application/font-sfnt application/font-woff application/javascript application/javascript-binast application/json application/ld+json application/manifest+json application/opentype application/otf application/rss+xml application/ttf application/truetype application/vnd.api+json application/vnd.ms-fontobject application/wasm application/xhtml+xml application/xml application/xml+rss application/x-httpd-cgi application/x-javascript application/x-opentype application/x-otf application/x-perl application/x-protobuf application/x-ttf;
7978 gzip_proxied any;
80- gzip_disable "MSIE [1-6]\. " ;
81-
82- # Cloudflare ips
79+ # Cloudflare IPs
8380 include /etc/nginx/conf.d/cloudflare.inc;
84-
85- # SSL PCI compliance
86- ssl_session_cache shared:SSL:20m ;
87- ssl_session_timeout 60m ;
88- ssl_buffer_size 1400 ;
89- ssl_protocols TLSv1.2 TLSv1.3;
90- ssl_prefer_server_ciphers on;
91- ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS" ;
81+ # SSL PCI compliance
82+ ssl_buffer_size 1369 ;
83+ ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256" ;
9284 ssl_dhparam /etc/ssl /dhparam.pem;
93- ssl_ecdh_curve secp384r1;
94- ssl_session_tickets off;
95- resolver 1.1.1.1 8.8.8.8 valid=300s ipv6=off;
85+ ssl_early_data on;
86+ ssl_ecdh_curve auto;
87+ ssl_prefer_server_ciphers on;
88+ ssl_protocols TLSv1.2 TLSv1.3;
89+ ssl_session_cache shared:SSL:20m ;
90+ ssl_session_tickets on;
91+ ssl_session_timeout 7d ;
92+ resolver 1.0.0.1 8.8.4.4 1.1.1.1 8.8.8.8 valid=300s ipv6=off;
9693 resolver_timeout 5s ;
9794 # Error pages
9895 error_page 403 /error/404 .html;
9996 error_page 404 /error/404 .html;
10097 error_page 410 /error/410 .html;
10198 error_page 500 501 502 503 504 505 /error/50x .html;
10299 # Proxy cache
103- proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m
104- max_size=1024m ;
100+ proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m ;
105101 proxy_cache_key "$scheme$request_method$host$request_uri" ;
106102 proxy_temp_path /var/cache/nginx/temp;
107- proxy_ignore_headers Expires Cache-Control;
108- proxy_cache_use_stale error timeout invalid_header http_502;
103+ proxy_ignore_headers Cache-Control Expires ;
104+ proxy_cache_use_stale error timeout invalid_header updating http_502;
109105 proxy_cache_valid any 1d ;
110106 # FastCGI cache
111- fastcgi_cache_path /var/cache/nginx/micro levels=1:2 keys_zone=microcache:10m
112- max_size=1024m inactive=30m ;
107+ fastcgi_cache_path /var/cache/nginx/micro levels=1:2 keys_zone=microcache:10m inactive=30m max_size=1024m ;
113108 fastcgi_cache_key "$scheme$request_method$host$request_uri" ;
114- fastcgi_cache_methods GET HEAD;
115- fastcgi_cache_use_stale updating error timeout invalid_header http_500 http_503;
116109 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
110+ fastcgi_cache_use_stale error timeout invalid_header updating http_500 http_503;
117111 add_header X-FastCGI-Cache $upstream_cache_status ;
118112
119113 # Cache bypass
@@ -131,4 +125,4 @@ http {
131125 # Wildcard include
132126 include /etc/nginx/conf.d/*.conf;
133127 include /etc/nginx/conf.d/domains/*.conf;
134- }
128+ }
0 commit comments