Nginx Rewrite rules!

Source: Internet
Author: User

#访问 $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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.