nginx/nginx.conf

115 lines
3.6 KiB
Nginx Configuration File
Raw Normal View History

2024-03-17 00:30:57 +09:00
#user me;
worker_processes 1;
error_log /opt/nginx/logs/error.log warn;
pid /opt/nginx/tmp/nginx.pid;
pcre_jit on;
timer_resolution 100ms;
events {
use epoll;
worker_aio_requests 128;
worker_connections 1024;
multi_accept on;
}
http {
include mime.types;
charset utf-8;
default_type application/octet-stream;
client_body_temp_path /opt/nginx/tmp/client_temp;
proxy_temp_path /opt/nginx/tmp/proxy;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /opt/nginx/logs/access.log main;
sendfile on;
aio threads;
aio_write on;
tcp_nopush on;
tcp_nodelay on;
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
keepalive_timeout 15s;
send_timeout 60s;
client_header_timeout 15s;
client_body_timeout 600s;
client_max_body_size 500m;
client_body_buffer_size 8K;
client_header_buffer_size 1k;
large_client_header_buffers 4 8k;
output_buffers 5 8m;
resolver_timeout 5s;
read_ahead 256k;
keepalive_disable msie6;
disable_symlinks if_not_owner;
if_modified_since before;
reset_timedout_connection on;
server_tokens off;
more_set_headers 'Server: AmazingFromHere';
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
# ssl_dyn_rec_enable on;
ssl_protocols TLSv1.2 TLSv1.3;
# ssl_ecdh_curve X25519:P-521:P-384;
# ssl_ciphers [ECDHE-ECDSA-CHACHA20-POLY1305|ECDHE-RSA-CHACHA20-POLY1305|ECDHE-ECDSA-AES256-GCM-SHA384|ECDHE-RSA-AES256-GCM-SHA384]:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
ssl_prefer_server_ciphers on;
ssl_session_cache builtin:1000 shared:SSL:50m;
ssl_session_timeout 1d;
ssl_session_tickets off;
gzip_static on;
gzip on;
gzip_comp_level 5;
gzip_min_length 512;
gzip_proxied any;
gzip_vary on;
gzip_disable "msie6";
gzip_types
text/plain
text/css
text/x-component
text/javascript application/x-javascript application/javascript text/x-js
image/svg+xml
text/plaintext/xsd text/xsl
text/xml application/xml application/rss+xml
application/json
font/truetype font/opentype application/x-font-otf application/x-font-ttf application/vnd.ms-opentype application/vnd.ms-fontobject application/font-woff application/font-woff2
audio/ogg
application/pdf
image/bmp image/x-icon image/webp image/tiff
audio/wav;
brotli_static on;
brotli on;
brotli_types
text/plain
text/css
text/x-component
text/javascript application/x-javascript application/javascript text/x-js
image/svg+xml
text/plaintext/xsd text/xsl
text/xml application/xml application/rss+xml
application/json
font/truetype font/opentype application/x-font-otf application/x-font-ttf application/vnd.ms-opentype application/vnd.ms-fontobject application/font-woff application/font-woff2
audio/ogg
application/pdf
image/bmp image/x-icon image/webp image/tiff
audio/wav;
include /opt/nginx/etc/conf.d/*.conf;
}