文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>nginx如何配置多站点

nginx如何配置多站点

时间:2010-10-21  来源:不会游泳的猪

include /etc/nginx/vhosts/*;

vhostsl里面存放着不同站点的配置,把本博客的例子贴上来:

server {
listen  80;
server_name  i.cteabox.com;

location / {
root   /var/www/tea/blog;
index  index.php index.html index.htm;
if (-d $request_filename){
rewrite ^/(.*)([^/])$ $1$2/ permanent;
}
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}

}

error_page   500 502 503 504  /50x.html;
location = /50x.html {
root  /var/www/tea/blog;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME   /var/www/tea/blog$fastcgi_script_name;
include        fastcgi_params;
}

location ~ /\.ht {
deny  all;
}

}

里面包括nginx的rewirte

相关阅读 更多 +
排行榜 更多 +
宝宝情商养成宝宝巴士

宝宝情商养成宝宝巴士

休闲益智 下载
燥热手机版

燥热手机版

飞行射击 下载
巨人狙击手安卓版

巨人狙击手安卓版

飞行射击 下载