Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2321044
  • 博文数量: 535
  • 博客积分: 8689
  • 博客等级: 中将
  • 技术积分: 7066
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-26 10:00
文章分类

全部博文(535)

文章存档

2024年(4)

2023年(4)

2022年(16)

2014年(90)

2013年(76)

2012年(125)

2011年(184)

2010年(37)

分类: LINUX

2011-06-29 20:56:02

#!/bin/sh
web_path=/data0/htdocs
cat  gz20|cut  -f1 |while read  argv1
        do
                argv2=`echo $argv1|sed 's/[^www|^blog]\.//g'`
                cat>>nginx.conf_bak.v<                server {
                 listen 80;
       server_name  $argv2 $argv1  ;
       index index.html index.htm index.php default.htm default.html default.php;
       root  $argv2 $argv1 ;
       include web_rewrite.conf;
log_format  $argv1 '\$remote_addr -\$remote_user [\$time_local] "\$request" '
              '\$status \$body_bytes_sent "\$http_referer" '
              '"\$http_user_agent" \$http_x_forwarded_for';
       access_log  /data1/logs/$argv1.log  argv1;
}
EOF
        done
 
 
 
 
 
 
 
 
 
#!/bin/sh
web_path=/data0/htdocs
cat 3blog2|cut -f1|while read argv1
   do
      argv2=`echo $argv1|sed 's/[^www|^blog]\.//g'`
      cat>>nginx.conf_bak.v<      server {
          listen 80;
          server_name  $argv2  $arvg1;
          root  $web_path/$argv1;
         index index.html index.htm index.php default.htm default.html default.php;
          location / {
                rewrite ^.*/files/(.*) /wp-content/blogs.php?file=\$1;
                if (!-e \$request_filename) {
                        rewrite ^.+?(/wp-.*) \$1 last;
                        rewrite ^.+?(/.*\.php)$ \$1 last;
                        rewrite ^ /index.php last;
                }
                error_page 404 = /index.php?q=\$uri;
           }
           location ~ {
                if (!-e \$request_filename) {
                        rewrite ^.+?/?(/wp-.*\\.php)\$ \$1 last;
                }
                include fastcgi_params;
                fastcgi_index index.php;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME $web_path/$argv1\$fastcgi_script_name;
                rewrite ^/.*(/wp-.*/.*.php)$ \$1;
           }
          
           location /status {
                stub_status on;
                access_log off;
           }
                
           location ~ /\\.ht {
                deny all;
          }
      }
EOF
   done
   
 
 
阅读(1150) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~