Changed nginx.conf
This commit is contained in:
parent
05bf6ee8ec
commit
a9b1e9a31d
74
nginx.conf
74
nginx.conf
@ -11,74 +11,64 @@ events {
|
|||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
|
|
||||||
##
|
##
|
||||||
# Basic Settings
|
# Basic Settings
|
||||||
##
|
##
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
tcp_nopush on;
|
tcp_nopush on;
|
||||||
types_hash_max_size 2048;
|
types_hash_max_size 2048;
|
||||||
# server_tokens off;
|
server_tokens off; # hide version
|
||||||
|
|
||||||
# server_names_hash_bucket_size 64;
|
|
||||||
# server_name_in_redirect off;
|
|
||||||
|
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
##
|
##
|
||||||
# SSL Settings
|
# TLS Defaults (site blocks can override)
|
||||||
##
|
##
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3; # drop TLSv1.0/1.1
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
|
|
||||||
ssl_prefer_server_ciphers on;
|
ssl_prefer_server_ciphers on;
|
||||||
|
|
||||||
##
|
##
|
||||||
# Logging Settings
|
# Logging (JSON)
|
||||||
##
|
##
|
||||||
|
log_format json escape=json
|
||||||
|
'{ "time":"$time_iso8601", "remote_addr":"$remote_addr", "request":"$request", '
|
||||||
|
'"status":$status, "body_bytes_sent":$body_bytes_sent, '
|
||||||
|
'"referer":"$http_referer", "ua":"$http_user_agent", '
|
||||||
|
'"request_time":$request_time, "upstream_time":"$upstream_response_time", '
|
||||||
|
'"host":"$host", "uri":"$uri" }';
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.json json;
|
||||||
|
|
||||||
##
|
##
|
||||||
# Gzip Settings
|
# Gzip (safe defaults)
|
||||||
##
|
##
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
|
gzip_comp_level 5;
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_types
|
||||||
|
text/plain text/css text/javascript application/javascript application/json
|
||||||
|
application/xml application/rss+xml image/svg+xml font/ttf font/otf;
|
||||||
|
|
||||||
# gzip_vary on;
|
##
|
||||||
# gzip_proxied any;
|
# Rate/Conn limit zones (used in site file)
|
||||||
# gzip_comp_level 6;
|
##
|
||||||
# gzip_buffers 16 8k;
|
limit_req_zone $binary_remote_addr zone=api_rps:10m rate=5r/s;
|
||||||
# gzip_http_version 1.1;
|
limit_conn_zone $binary_remote_addr zone=perip:10m;
|
||||||
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
##
|
||||||
|
# AI bot block map (optional; enforce in server with: if ($block_ai) { return 403; })
|
||||||
|
##
|
||||||
|
map $http_user_agent $block_ai {
|
||||||
|
default 0;
|
||||||
|
~*(GPTBot|ChatGPT-User|OAI-SearchBot|CCBot|ClaudeBot|PerplexityBot) 1;
|
||||||
|
}
|
||||||
|
|
||||||
##
|
##
|
||||||
# Virtual Host Configs
|
# Virtual Host Configs
|
||||||
##
|
##
|
||||||
|
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
include /etc/nginx/sites-enabled/*;
|
include /etc/nginx/sites-enabled/*;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#mail {
|
|
||||||
# # See sample authentication script at:
|
|
||||||
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
|
|
||||||
#
|
|
||||||
# # auth_http localhost/auth.php;
|
|
||||||
# # pop3_capabilities "TOP" "USER";
|
|
||||||
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
|
|
||||||
#
|
|
||||||
# server {
|
|
||||||
# listen localhost:110;
|
|
||||||
# protocol pop3;
|
|
||||||
# proxy on;
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# server {
|
|
||||||
# listen localhost:143;
|
|
||||||
# protocol imap;
|
|
||||||
# proxy on;
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user