MagentoはNginx+PHP-FPMスタックで正常に実行されていますが、カートから商品を削除したり、商品ページにタグを追加したりするたびに、ホームページにリダイレクトされます。
$this->_redirectReferer(Mage::getUrl('*/*'));
app / code / core / Mage / Checkout / controllers / CartController.phpで置き換えると、カートの問題が「修正」されることは承知してい$this->_redirect('checkout/cart');
ますが、タグの問題はどうでしょうか。Magentoコアをハッキングする代わりにnginx.confに追加/改善できるルールはありますか?不思議なことに、それはNgixでのみ発生し、Apacheでは発生しません。
これが私の設定の抜粋です:
location @handler { ## Magento uses a common front handler
rewrite / /index.php;
}
location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
rewrite ^(.*.php)/ $1 last;
}
# Pass PHP scripts on to PHP-FPM
location ~* \.php$ {
if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
#expires off; ## Do not cache dynamic content
fastcgi_pass unix:/var/spool/phpfpm.sock; ## php-fpm socket
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
#fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
}