Nginx的rewrite
    rewrite regex replacement flag;
    rewrite ^/images/(.*\.jpg)$ /imgs/$1 所有的图片跳转到/imgs/$1
break;(结束位)
rewrite ^/shop/(.*\html)$ /tuangou/$1 break;
rewrite ^/shop/(.*\.php)$ http://www.baidu.com/$1 [redirect | permanent];
    last - 基本上都用这个Flag(多级跳转)
    break - 中止Rewirte,不在继续匹配
    redirect - 返回临时重定向的HTTP状态302
    permanent - 返回永久重定向的HTTP状态
    ^(.*)$ //所有的请求
301
rewrite的confition
    语法:if  (condition) {..}
    应用环境:server,location
    
upsteam name{ //nginx负载均衡
    wrr; //加权算法
server //外部服务器 weight=2 max_fails=1 fail_timeout=1s;
    server //外部服务器 weight=1 [down | backup];
}//单配置到http段
lcation / {
    proxy_pass http://name; //跳转到http://name 
}
error_page 404 /404.html;
location = /404.html {
    root /web/404;
}
alias /web 把"/" 别名成/web
原文:http://knowledgeq.blog.51cto.com/9549168/1901667