|
求一个可用的配置,目前搜索到一些,试了一下都不行,目前的配置是:
server {
listen 80;
server_name www.test.com;
location / {
root E:/svn/osweb;
index index.html index.htm index.php default.php;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ .*\.php?$ {
root E:/svn/osweb;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME E:/svn/osweb$fastcgi_script_name;
include fastcgi_params;
}
}
----曾增加过rewrite规则---
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
---也曾增加nginx支持path的---
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
-------------config
$config['base_url'] = 'http://www.test.com';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'PATH_INFO';
--------router
$route['default_controller'] = 'welcome';
$route['login'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
但是目前都是404,除了通过www.test.com能访问到默认页面之外,访问任何都是404,
如www.test.com/welcome
www.test.com/login
求解决谢谢,环境:
NPMserv 是一款界面化的快速搭建nginx0.7.63、PHP 5.2.11、MySQL 5.1.28、phpMyAdmin 3.2.1,网站服务器平台的绿色软件。
作者:NginxCN团队
|
|