Nginx 和 PHP-FPM 阻止文件夹名称中包含 "php"

Nginx and PHP-FPM blocking folder with contains "php" in the name

我正在使用 Nginx 和 PHP-FPM 通过 Magento 开发电子商务。

我有一个名为 "boletophp" 的文件夹,站点正在尝试访问此 link:"my.store/skin/boletophp/imagens/logobb.jpg" 并且 Nginx 将 link 重写为 "my.store/skin/boletophp/" .

我将文件夹名称更改为"boleto"并且图像加载成功,但模块无法正常工作。所以文件夹名称需要是 "boletophp".

这是 my.store 配置文件:

server {
    server_name my.store;
    access_log /srv/www/my.store/logs/access.log;
    error_log /srv/www/my.store/logs/error.log;
    root /srv/www/my.store/public_html;

    location / {
        index index.html index.htm index.php;
        try_files $uri $uri/ @handler;
    }

    location ~ ^/(app|includes|lib|media/downloadable|pkginfo|report/config.xml|var)/ { internal; }
    location /var/export/ { internal; }
    location /. { return 404; }
    location @handler { rewrite / /index.php; }
    location ~* .php/ { rewrite ^(.*.php)/  last; }

    location ~ \.php$ {
        client_max_body_size 2048M;
        expires off;
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /srv/www/my.store/public_html$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE default;
        fastcgi_param MAGE_RUN_TYPE store;
    }

    location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
        expires 30d;
        add_header Pragma public;
        add_header Cache-Control "public";
    }
}

版本:

  Nginx: 1.6.2
    PHP: 5.6.5
Magento: 1.9.1

亲切的问候,

威廉·伯坦

尝试替换行:

location ~* .php/ { rewrite ^(.*.php)/  last; } 

来自

location ~* \.php/ { rewrite ^(.*.php)/  last; }

希望对您有所帮助!