#访问 $uri # if exists $uri, visit him # If $uri are not end Of/and exists/vhosts/$http _host/$uri, visit him # if $uri is end of /And exists/cache/$http _host/$uri-/index.php #结束 (by [email protected]-please contact us if you have any errors) serve R{ Listen; server_namegame1.wap.loc game2.wap.loc game3.wap.loc wap.loc www.wap.loc; Location/ { RootD:/dev_wap; Indexindex.html index.htm index.php; Try_files$uri/vhosts/$http _host/$uri/cache/$http _host/$uri/index.html @rewrite; Location~ \.php$ { Try_files$uri =404; Fastcgi_pass127.0.0.1:9000; Fastcgi_indexindex.php; Fastcgi_paramscript_filename $document _root$fastcgi_script_name; includeFastcgi_params; } } Location@rewrite { rewrite[^\/]$ $uri/redirect; rewrite./index.php?s= $uri & $args last; } #error_page 404/404.html;# REDIRECT Server error pages to the static page/50x.html # Error_page502 503 504/50x.html; Location =/50x.html { Roothtml; } Location~ /\. (Ht|svn|git) { DenyAll ; }}
Nginx Rewrite rules!