小编Kam*_*mik的帖子

Magento 1.7 REST API nginx重写规则.api.php没有执行

如果我打开链接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 …
Run Code Online (Sandbox Code Playgroud)

api rest rewrite nginx magento

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

标签 统计

api ×1

magento ×1

nginx ×1

rest ×1

rewrite ×1