server { listen 80; listen 443; server_name xin18.org; access_log logs/xin18.org.log main; #location /buyu { # root /opt/nginx/html/web-mobile/; # index index.html index.htm; #} location /longhu { #root /opt/nginx/html/web-mobile-old/; alias html/web-mobile-old/; #alias html/longhu/; index index.html index.htm; #expires 0; } location / { #if ( $query_string ~* "gameId=118" ){ # rewrite ^/(.*)$ http://xin18.org/buyu; # } if ( $query_string ~* "gameId=108" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } if ( $query_string ~* "gameId=128" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } if ( $query_string ~* "gameId=138" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } if ( $query_string ~* "gameId=188" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } if ( $query_string ~* "gameId=186" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } if ( $query_string ~* "gameId=198" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } if ( $query_string ~* "gameId=195" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } if ( $query_string ~* "gameId=199" ){ rewrite ^/(.*)$ http://xin18.org/longhu; } root /opt/nginx/html/web-mobile/; index index.html index.htm; } } # if ( $query_string ~* "gameId=199" ){ ##如果id不等于199 那么转发去longhu??? # rewrite ^/(.*)$ http://xin18.org/longhu; # }