public:it:nginx

nginx

  • 停止nginx -s stop
  • 重载配置 nginx -s reload
  • location 配置语法:official doc
    location [ = | ~ | ~* | ^~ ] uri { ... }
    location @name { ... }
    • 默认(无标记)是前缀最长匹配;
    • =: 表示精确匹配才执行操作
    • ~: 表示执行正则匹配,且区分大小写
    • ~*: 表示执行正则匹配,但区分大小写
    • ^~: 表示普通字符匹配,前缀匹配有效则配置直接生效,停止向下查找
    • @ 自定义量
    • 匹配优先级官方文档:
      1. Directives with the = prefix that match the query exactly. If found, searching stops.
      2. All remaining directives with conventional strings, longest match first. If this match used the ^~ prefix, searching stops.
      3. Regular expressions, in order of definition in the configuration file.
      4. If #3 yielded a match, that result is used. Else the match from #2 is used.
    • 中文:
      1. = 的指令严格匹配这个查询。如果找到,停止搜索。
      2. 所有剩下的常规字符串,最长的匹配。如果这个匹配到^〜前缀,搜索停止。
      3. 正则表达式,在配置文件中定义的顺序。
      4. 如果第3条规则产生匹配的话,结果被使用。否则,使用第2条规则的结果。
  • public/it/nginx.txt
  • 最后更改: 2023/08/02 09:48
  • oakfire