Magento Enterprise返回404错误:在CentOS的nginx上找不到页面
我在nginx、php和fpm上运行magento时遇到了一些大问题 我花了三天时间试图解决这个问题。我无法打开任何页面(包括主页) 这是我的nginx.conf:Magento Enterprise返回404错误:在CentOS的nginx上找不到页面,magento,url-rewriting,nginx,centos,Magento,Url Rewriting,Nginx,Centos,我在nginx、php和fpm上运行magento时遇到了一些大问题 我花了三天时间试图解决这个问题。我无法打开任何页面(包括主页) 这是我的nginx.conf: user nginx; worker_processes 1; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;
#
fastcgi_send_timeout 1800;
fastcgi_read_timeout 1800;
fastcgi_connect_timeout 1800;
}
这是我的default.conf
server {
root /var/www/;
index index.php;
server_name magento.example.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;
}
}
缓存已禁用。Url_重写为。请告诉我,如何调试它 我删除fastcgi_参数MAGE_RUN_代码默认值;因为我没有默认存储,现在它可以工作了。请小心更改默认存储的代码:某些Magento代码中有硬编码,因此这样做可能会破坏某些标准功能。