cainoma 发表于 2013-03-20 12:15

能帮忙看下如下apache规则用nginx怎么实现吗?


RewriteRule ^([^.]+)\.xiao\.com/(.*)$ http://haha.xiao.com/$1/$2


我这样写的 但是没效果出现404了   
location/(.*) {
                if ( $uri ~ "(.*)" ) {
                        set $uri_var $1;
                }
                if ( $host ~ "([^.]+)\.xiao\.com" ) {
                        set $host_var $1;
                }
                proxy_pass http://haha.xiao.com/$host_var/$uri_var;
      }
页: [1]
查看完整版本: 能帮忙看下如下apache规则用nginx怎么实现吗?