小编Chr*_*ris的帖子

Nginx 和 PHP-FPM 403 禁止

我正在将 Nginx 与 PHP-FPM 一起使用。显示请求的页面,但萤火虫显示 CSS、JS 和图像的路径返回 403 Forbidden 错误,这破坏了样式。

查看日志:

013/03/09 21:15:43 [error] 1012#0: *17 FastCGI sent in stderr: "Access to the script '/var/www/my_server/extras/extras/go/_common/imgs/WebLogo2-trans.png' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 33.33.33.1, server: my-server.com, request: "GET /extras/extras/go/_common/imgs/WebLogo2-trans.png HTTP/1.1", upstream: "fastcgi://unix:/var/tmp/php-fpm.sock:", host: "www.my-server.com", referrer: "http://www.my-server.com/extras/better/"
Run Code Online (Sandbox Code Playgroud)

但是,我尝试设置security.limit_extensions = .php .css .js .jpg只是为了看看会发生什么,但是 mimetype 被解释为 text/html 并且不会加载。

我试过 chmod 777 每个文件和目录,但没有运气。

这是 Nginx 服务器块:http : //dpaste.com/1017993/和相关位置块。位置块包含在另一个文件中,该文件未反映在服务器块中:

     location /extras/ {
            access_log /var/log/nginx/my_server/extras.log debug_phpfpm;
            include …
Run Code Online (Sandbox Code Playgroud)

php nginx php-fpm

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

nginx ×1

php ×1

php-fpm ×1