nginx在用户使用ie的使用重定向到/nginx-MSIE目录下

[root@web01 ]# cat /app/server/nginx/conf/rewrite/default.conf
#rewrite ^/index\.html /index.php last;
#if (!-e $request_filename) rewrite ^/(.*)$ index.php last;
#if (!-e $request_filename) {rewrite ^/(.*)$ /index.php last;}
#if (!-e $request_filename) {return 404;}
if ($http_user_agent ~ Firefox) {rewrite ^(.*)?$ /nginx-Firefox/$ break;}
if ($http_user_agent ~ MSIE) {rewrite ^(.*)$ /nginx-MSIE/$ break;}
#rewrite ^/(\d+)/(.+)/ /$/$ last;
#####################下面的补充说明########################
[root@web01 ]# cat /app/server/nginx/conf/vhosts/default.conf
server {
listen ;
server_name espressos.cn;
index index.php index.htm index.html;
root /app/www/default;
location ~ .*\.(sh|bash)?$
{
return ;
}
# if (!-e $request_filename) {
# rewrite ^/(.*)$ /index.php last;
# }
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
include /app/server/nginx/conf/rewrite/default.conf;
access_log /app/log/nginx/access/default.log;
}
###################################
[root@web01 ]# tree /app/www/default/
/app/www/default/
├── index.php
├── nginx-Firefox
│   └── index.php
├── nginx-MSIE
│   └── index.php
└── ss
└──
└── index.php directories, files
[root@web01 ]# cat /app/www/default/nginx-Firefox/index.php
Firefox
<?php phpinfo();
[root@web01 ]# cat /app/www/default/nginx-MSIE/index.php
MSIE
<?php phpinfo();
[root@web01 ]#

nginx在用户使用ie的使用重定向到/nginx-MSIE目录下nginx在用户使用ie的使用重定向到/nginx-MSIE目录下

上一篇:POJ 1182食物链(分集合以及加权两种解法) 种类并查集的经典


下一篇:Qsort(c)_Sort(c++)用法