nginx禁止static目录的php执行权限

location ^~ /static/ {
    # 禁止PHP文件访问
    location ~ \.php$ {
        deny all;
        return 403;
    }
    
    # 其他静态文件配置
    try_files $uri =404;
    expires max;
    access_log off;
}

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

滚动至顶部