【发布时间】:2014-01-03 07:31:47
【问题描述】:
我正在尝试将琐碎的 htaccess 文件转换为 Nginx,但无法使其工作。它返回 404 错误。 这是htaccess的内容:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
这是我当前的 nginx 配置:
server {
listen 80;
server_name domain.biz;
root /var/www/domain.biz;
charset utf-8;
autoindex off;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www/domain.biz$fastcgi_script_name;
}
}
【问题讨论】: