私の現在のセットアップでは、Ubuntu 12.04 LTS、Nginx 1.4.1、Magento 1.7.0.2 を実行しています。
今日、基本的な Magento ストアをセットアップしました。モジュールをインストールしておらず、構成を変更していません。システムをさらに掘り下げる前に、基礎を築きたいだけです。ドメイン名とファイル パスの間に表示される「index.php」を削除しようとしています。
私の vhost は、nginx の Web サイトから取得したものです。
server {
root /path/to/root/domain/html;
index index.php;
error_log /path/to/error/log/error.log;
access_log /path/to/transfer/log/transfer.log;
server_name servername.com;
location / {
index index.html index.php;
try_files $uri $uri/ @handler;
expires 30d;
}
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;
}
}
他の人がこの質問に対する答えを探しているようです。解決策へのコード スニペットがありますが、これらのどれも私のシステムでは動作しないようです。Nginx vhost に変更を加えると、常に nginx を再起動しますが、index.php は依然として URL に表示されます。