虚拟主机403_CDN WAF与源站403区分
华为云虚拟主机做虚拟主机403,Nginx 的 403 常见原因是目录下没有 index 文件且 autoindex off(目录浏览关闭),访问目录时 Nginx 找不到默认首页就返回 403。上传 index.html/index.php 或开启 autoindex 即可。Apache 的 403 常见是 Options -Indexes 或权限问题。
deny 规则排查:Apache 的 .htaccess 里有 Deny from all 或 Order Deny,Allow 配置错误;Nginx 的 server/location 里有 deny all;IIS 的 web.config 里有 ipSecurity 或 authorization 规则。注释掉可疑规则测试,找到触发 403 的规则后修正。防盗链规则误杀自己域名的,把自己域名加进白名单。
参考(Nginx 403配置示例): ``` # 默认首页 server { listen 80; server_name 域名; root /www/wwwroot/域名; index index.html index.htm index.php;
# 禁止访问特定目录 location ~* /(admin|install)/ { # deny all; # 注释掉测试 allow 你的IP; deny all; }
# PHP处理 location ~ .php$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; } }
# SELinux上下文(CentOS) chcon -R -t httpd_sys_content_t /www/wwwroot/域名 chcon -R -t httpd_sys_rw_content_t /www/wwwroot/域名/upload ```
403 和 SEO 的关系:403 页面百度蜘蛛抓取失败,持续 403 会导致收录下降、排名掉。整站 403 要立即修复,部分页面 403 检查是否是误封。robots.txt 不要禁止正常页面,403 和 robots 禁止是两回事,403 是服务器拒绝,robots 是告诉蜘蛛不要抓。
Apache 403 专项:Apache 错误日志在 /var/log/httpd/error_log 或 /var/log/apache2/error.log,常见 "client denied by server configuration"(deny 规则或 Options)、"Permission denied"(文件系统权限)。.htaccess 语法错误会导致 500 不是 403,注意区分。

更新时间:2026-09-02 14:55:18
上一篇:网站运维_网站流量下降排查