File tree Expand file tree Collapse file tree 5 files changed +44
-0
lines changed
Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ # GZip 和 Brotli
2+ gzip on;
3+ gzip_comp_level 6;
4+ gzip_min_length 1k;
5+ gzip_types text/plain text/css text/xml text/javascript text/x-component application/json application/javascript application/x-javascript application/xml application/xhtml+xml application/rss+xml application/atom+xml application/x-font-ttf application/vnd.ms-fontobject image/svg+xml image/x-icon font/opentype;
6+ brotli on;
7+ brotli_comp_level 6;
8+ brotli_min_length 1k;
9+ brotli_types text/plain text/css text/xml text/javascript text/x-component application/json application/javascript application/x-javascript application/xml application/xhtml+xml application/rss+xml application/atom+xml application/x-font-ttf application/vnd.ms-fontobject image/svg+xml image/x-icon font/opentype;
Original file line number Diff line number Diff line change 1+ proxy_redirect off;
2+ proxy_headers_hash_max_size 512;
3+ proxy_headers_hash_bucket_size 128;
4+ proxy_set_header Host $host;
5+ proxy_set_header X-Forwarded-Proto $scheme;
6+ proxy_set_header X-Real-IP $remote_addr;
7+ proxy_set_header X-Forwarded-For $remote_addr;
8+ proxy_set_header X-Forwarded-Host $server_name;
9+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Original file line number Diff line number Diff line change 1+ #证书部分
2+ #ssl_certificate /etc/nginx/ssl/fullchain.cer;
3+ #ssl_certificate_key /etc/nginx/ssl/gclmit.club.key;
4+ #ssl_dhparam /etc/nginx/ssl/dhparam.pem;
5+
6+ #TLS 握手优化
7+ ssl_session_cache shared:SSL:1m;
8+ ssl_session_timeout 5m;
9+ keepalive_timeout 75s;
10+ keepalive_requests 100;
11+
12+ #TLS 版本控制
13+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
14+ ssl_ciphers 'TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5';
15+
16+ # 开启 1.3 o-RTT
17+ ssl_early_data on;
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ module_hotfixes=true
2424EOF
2525
2626yum install -y nginx
27+ mkdir -p /etc/nginx/snippets
28+ wget -0 /etc/nginx/snippets/compression.conf https://gitee.com/gclm/one-key-linux/raw/master/config/nginx/snippets/compression.conf
29+ wget -0 /etc/nginx/snippets/default.conf https://gitee.com/gclm/one-key-linux/raw/master/config/nginx/snippets/default.conf
30+ wget -0 /etc/nginx/snippets/ssl.conf https://gitee.com/gclm/one-key-linux/raw/master/config/nginx/snippets/ssl.conf
2731clear
2832echo " Nginx 安装完成"
2933nginx -v
Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ chmod 700 /var/cache/nginx/*
6262# nginx 默认配置
6363mkdir /etc/nginx/conf.d
6464wget -O nginx.conf https://gitee.com/gclm/one-key-linux/raw/master/config/nginx/nginx.conf
65+
66+ mkdir /etc/nginx/snippets
67+ wget -0 /etc/nginx/snippets/compression.conf https://gitee.com/gclm/one-key-linux/raw/master/config/nginx/snippets/compression.conf
68+ wget -0 /etc/nginx/snippets/default.conf https://gitee.com/gclm/one-key-linux/raw/master/config/nginx/snippets/default.conf
69+ wget -0 /etc/nginx/snippets/ssl.conf https://gitee.com/gclm/one-key-linux/raw/master/config/nginx/snippets/ssl.conf
6570}
6671
6772main (){
You can’t perform that action at this time.
0 commit comments