nginx location非常重要:

      location  /URI/ {       URI

      root "/web/htdocs";  URI存放对应的目录,访问权限

 }  

   location [ = | ~ | -* | ^~ ] URI{....}

    ocation {} @ name{....}

    location  URI  {}     对当前路径及子路径下的所有对象都生效; 

    location  = URI {}    精确匹配指定的路径;只对当前路径生效;(优先级最高)

    location  ~ URI {}    模式匹配URI,此处的URI可以使用正则表达式,~区分字符大小写;

    location  ~* URI {}   模式匹配URI,此处的URI可以使用正则表达式,~*不区分字符大小写;

    location  ^~ URI {}   不使用正则表达式(优先级次之)

  如:  location  / {

        root   /web/htdocs;   

        index  index.html; 

location  /bbs/ {          到web路径下去找bbs目录

        root   /web;  

        index  index.html; 

deny 192.168.1.5;