1

I'm developing an eCommerce with Magento using Nginx and PHP-FPM.

I have a folder called "boletophp" and the site is trying to access this link: "my.store/skin/boletophp/imagens/logobb.jpg" and the Nginx rewrites the link to "my.store/skin/boletophp/".

I changed the folder name to "boleto" and the image loaded successfully, but the module doesn't work properly. So the folder name need to be "boletophp".

This is my.store config file:

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)/ $1 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";
    }
}

Versions:

  Nginx: 1.6.2
    PHP: 5.6.5
Magento: 1.9.1

Kind regards,

William Bertan

3
  • 1
    Not sure about this, but try replacing location ~* .php/ { rewrite ^(.*.php)/ $1 last; } by location ~* \.php/ { rewrite ^(.*.php)/ $1 last; } Commented Feb 11, 2015 at 11:29
  • GREAT! Post an answer for me give to you the right answer! Thank You! Commented Feb 11, 2015 at 11:33
  • I'm grad it worked! :) Commented Feb 11, 2015 at 11:37

1 Answer 1

4

Try replacing the line:

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

by

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

I hope it helps!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.