参考消息
log buffer=32k; 调整 client_body_buffer_s😎ize 和 client_header_buffer_size ,避免大请求头导致临时文件写入
在 location / 中设置 🎉User-Agent 过滤,允许Baiduspider等搜索引擎爬虫,拒掉恶意UA
3; 建议使用Let's Encrypt免费证书,并设置自动续期,避免因证书过期导致抓取失败
可以: 将 access_log 关掉或改为缓存写入: access_log off; 或 access_log /var/log/nginx/access
第一步:合理配置Worker进程与连接数 Nginx采用异步非阻塞模型, worker_processes 通常设为服务器CPU核心数, worker_co⭐nnections 则根据内存情况调整
温馨提示 :以上优化🔍步骤适用于大多数中低负载的网站