diff --git a/easyai-proxy.conf.sample b/easyai-proxy.conf.sample index 260f77a..72d16c0 100644 --- a/easyai-proxy.conf.sample +++ b/easyai-proxy.conf.sample @@ -32,6 +32,21 @@ server { listen [::]:80; server_name 51easyai.com; + # EasyAI response gzip: compress JSON/text API responses; SSE/WebSocket stay uncompressed by content type. + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_comp_level 4; + gzip_proxied any; + gzip_types + application/json + application/javascript + application/xml + text/css + text/plain + text/xml + image/svg+xml; + # ssl 版本控制 ssl_protocols TLSv1.2 TLSv1.3; # 只启用 TLS 1.2 和 TLS 1.3 # 通用安全头部 diff --git a/https.sh b/https.sh index 9042673..76f0d0c 100755 --- a/https.sh +++ b/https.sh @@ -180,6 +180,21 @@ server { listen [::]:80; server_name $domain; + # EasyAI response gzip: compress JSON/text API responses; SSE/WebSocket stay uncompressed by content type. + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_comp_level 4; + gzip_proxied any; + gzip_types + application/json + application/javascript + application/xml + text/css + text/plain + text/xml + image/svg+xml; + location /.well-known/acme-challenge/ { root /var/www/certbot; try_files \$uri =404; @@ -357,4 +372,4 @@ if [ -n "$DOMAINS" ]; then # 启动 Nginx 服务 echo "启动 Nginx 服务..." sudo nginx -fi \ No newline at end of file +fi