nginx.conf中的 "location logs "和 "location logs "的区别是什么?

问题描述 投票:0回答:1

我需要知道以下两行在 nginx.conf......以及他们的使用案例。

位置日志 {

位置日志 {

java security nginx webserver nginx-config
1个回答
0
投票

这在以下地点的文件中有所涉及 http:/nginx.orgendocshttpngx_http_core_module.html#location。

如果一个位置是由一个以斜线字符结尾的前缀字符串定义的,并且请求是由proxy_pass、fastcgi_pass、uwsgi_pass、scgi_pass、memcached_pass或grpc_pass中的一个来处理的,那么就会进行特殊处理。如果请求的URI等于这个字符串,但没有尾部的斜线,则会返回一个带有301代码的永久重定向到请求的URI,并附加斜线。如果不希望这样,可以像这样定义一个完全匹配的URI和位置。

location /user/ {
    proxy_pass http://user.example.com;
}

location = /user {
    proxy_pass http://login.example.com;
}

希望能帮到你

© www.soinside.com 2019 - 2024. All rights reserved.