http://www.exam.com/index.php/welcome/index CI框架在NGINX服务器报404?
http://www.exam.com/index.php/welcome/index 为什么nginx 服务器报404 解析不了url呢:L 现在首页框架下载的有问题 URL 解析有BUG 我用以前下载的框架资源没有问题了 应该是服务器配置的问题 同问啊 一样 http://www.php100.com/html/itnews/PHPxinwen/2011/0705/8401.html这个链接里可以解决问题的 估计就是 PATH_INFO的问题 谢谢各位 解决了 是nginx 默认不支持path_info 模式现已解决! fastcgi.conf 内容
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
##########################################pathinfo 模式
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$"){
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
##########################################nginx支持pathinfo 模式的重点
fastcgi_paramGATEWAY_INTERFACECGI/1.1;
fastcgi_paramSERVER_SOFTWARE nginx/$nginx_version;
fastcgi_paramQUERY_STRING $query_string;
fastcgi_paramREQUEST_METHOD $request_method;
fastcgi_paramCONTENT_TYPE $content_type;
fastcgi_paramCONTENT_LENGTH $content_length;
fastcgi_paramREQUEST_URI $request_uri;
fastcgi_paramDOCUMENT_URI $document_uri;
fastcgi_paramDOCUMENT_ROOT $document_root;
fastcgi_paramSERVER_PROTOCOL $server_protocol;
fastcgi_paramREMOTE_ADDR $remote_addr;
fastcgi_paramREMOTE_PORT $remote_port;
fastcgi_paramSERVER_ADDR $server_addr;
fastcgi_paramSERVER_PORT $server_port;
fastcgi_paramSERVER_NAME $server_name;
fastcgi_param PATH_INFO $path_info;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
#fastcgi_paramREDIRECT_STATUS 200;
nginx.conf 内容如下
#user nobody;
worker_processes1;
#error_loglogs/error.log;
#error_loglogs/error.lognotice;
#error_loglogs/error.loginfo;
pid logs/nginx.pid;
events {
worker_connections1024;
}
http {
include mime.types;
default_typeapplication/octet-stream;
log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_loglogs/access.logmain;
sendfile on;
#tcp_nopush on;
#keepalive_timeout0;
keepalive_timeout65;
gzipon;
#包含虚拟目录配置
include vhost.conf;
}
vhost.conf 内容如下
#phpMyAdmin
server {
listen 80;
server_name www.phpmyadmin.com;
index index.php index.html index.htm;
root "/servers/apps/phpMyAdmin";
location ~ \.php{
include fastcgi.conf;
}
}
#CI
server {
listen 80;
server_name www.ci.com;
index index.php index.html index.htm;
root "/servers/apps/CI";
location ~ \.php{
include fastcgi.conf;
}
}
页:
[1]