location

location

 

简介

  使用Nginx Location可以控制访问网站的路径, 但一个server可以有多个location配置, 多个location的优先级该如何区分

 

location匹配符号

 

 

server {
    listen 80;
    server_name _;
   
    location ~* /python {
        default_type text/html;
        return 200 "Location ~*";
    }

    location ~ /Python {
        default_type text/html;
        return 200 "Location ~";
    }

    location ^~ /python {
        default_type text/html;
        return 200 "Location ^~";
    }

    location = /python {
        default_type text/html;
        return 200 "Location =";
    }
}

 

 

END

 

posted @ 2022-01-05 18:40  Snails蜗牛  阅读(329)  评论(0编辑  收藏  举报