合集 安全 下的文章

Linux VPS服务器性能优化命令

1. 基础系统优化1.1 关闭不必要的服务检查并禁用不必要的后台服务,减少资源占用:# 查看正在运行的服务 systemctl list-units --type=service --state=running # 禁用并停止服务 systemctl disable --now <service-name>常见可关闭服务:cups - 打印服务bluetooth - 蓝牙服务avahi-daemon - Zeroconf/Bonjour服务rpcbind - 旧版NFS服务1.2 系统与软件包更新保持系统最新以确保安全性和性能:# Debian/Ubuntu apt update && apt upgrade -y && apt autoremove -y # CentOS/RHEL yum update -y && yum clean all1.3 启用BBR拥塞控制算法优化TCP网络传输性能:# 配置BBR cat >> /etc/sysctl.conf <<EOF net.core.defau

nginx安全规则分享

常用 Nginx 安全规则以下是一些常用的 Nginx 安全规则,可根据实际需求添加到配置文件中。1. 敏感词请求拦截规则:当请求 URL 中包含敏感词时,跳转下载 10GB 文件。代码:if ($request_uri ~* "(\.gz)|(")|(\.tar)|(admin)|(\.zip)|(\.sql)|(\.asp)|(\.rar)|(function)|($_GET)|(eval)|(\?php)|(config)|(\')|(\.bak)") { return 301 http://lg-dene.fdcservers.net/10GBtest.zip; }2. 禁止下载特定文件类型规则:禁止下载 .zip、.rar、.sql 等文件。代码:location ~ \.(zip|rar|sql|bak|gz|7z)$ { return 444; }3. 特定关键词跳转规则:当 URL 中包含 test= 时,跳转到公安网。代码:if ($request_uri ~* test=) { return 301 h

目录