2

リンクhttp://example.com/api/rest/productsを開くと、api.php がダウンロードされただけで、スクリプトは実行されません。

それは何でしょうか?

Magentoサイトのnginxルールがあります

location /api {
  rewrite ^/api/rest /api.php?type=rest break;
}
location / {
    index index.html index.php;
    try_files $uri $uri/ @handler;
    expires 30d;
}

location ~ (/(app/|includes/|lib/|/pkginfo/|var/|report/config.xml)|/\.svn/|/.hta.+) {
             deny all;
}

  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$ {
    if (!-e $request_filename) { rewrite / /index.php last; }
    expires off;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param MAGE_RUN_CODE default;
    fastcgi_param MAGE_RUN_TYPE store;
    include fastcgi_params;
  }
4

2 に答える 2

4

これをnginx構成に書く必要があります:

   location /api 
    {
    rewrite ^/api/rest /api.php?type=rest last;
    rewrite ^/api/v2_soap /api.php?type=v2_soap last;
    rewrite ^/api/soap /api.php?type=soap last;
    }
于 2014-08-08T06:47:04.680 に答える