- 积分
- 16
- 威望
-
- 金钱
-
- 注册时间
- 2011-11-18
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
log_format www.weadge.com '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server
{
listen 80;
server_name www.weadge.com weadge.com weiba.weadge.com home.weadge.com;
index index.html index.htm index.php default.html default.htm default.php;
root /weadge/www;
#----------------------------------------------------------------------------------
if ($host = 'weadge.com') {
rewrite ^(.*)$ http://www.weadge.com$1 permanent;
}
# set $mainflag "0";
# if ($host = 'www.weadge.com'){
# set $mainflag "${mainflag}1";
# }
# if ($request_uri = "/"){
# set $mainflag "${mainflag}2";
# }
# if ($mainflag = "012"){
# rewrite ^/ http://home.weadge.com$1 break;
# }
#
error_page 404 /404.htm;
location / {
proxy_pass http://home.weadge.com;
if (-f $request_filename) {
break;
}
if ($request_filename ~* "\.(js|ico|gif|jpe?g|bmp|png|css)$") {
break;
}
if (!-e $request_filename) {
rewrite . /index.php last;
}
}
想要实现的功能是 当访问www.weadge.com时 隐式跳转到home.weadge.com 地址栏里的URL不变
现在的配置 日志里报如下错误
2013/04/22 21:19:02 [alert] 21774#0: accept() failed (24: Too many open files)
2013/04/22 21:19:02 [alert] 21774#0: *51196 socket() failed (24: Too many open files) while connecting to upstream, client: 60.191.57.43, server: www.weadge.com, request: "GET / HTTP/1.0", upstream: "http://60.191.57.43:80/", host: "home.weadge.com"
2013/04/22 21:19:07 [alert] 21774#0: *102386 socket() failed (24: Too many open files) while connecting to upstream, client: 60.191.57.43, server: www.weadge.com, request: "GET /favicon.ico HTTP/1.0", upstream: "http://60.191.57.43:80/favicon.ico", host: "home.weadge.com"
报http 500错误
如果把
则能正常显示qq.com的内容
求解决办法 |
|