#CI
server {
listen 80;
server_name www.ci.com;
index index.php index.html index.htm;
root "/servers/apps/CI";
location ~ \.php{
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;
}
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
##########################################nginx支持pathinfo 模式的重点
}
}
nginx.conf 加入
#禁止IP访问
server
{
listen 80 default;
server_name _;
return 500;
}
server 加在 http 中
http { server{} }