chaizhenhua

map指令简单介绍

当然这里写的都是官方文档是已经写过的,我简单抄一下哈。

map指令来自于 ngx_http_map_module 模块,提供的核心能力是 基于一个变量创建一个新变量,大概是这意思。

语法: 只能配置在http块内
map string $variable {...}

直接看这个语法好像看不出来它能干什么,所以官方文档上给了几个例子:

map $http_host $name {
    hostnames;

    default       0;

    example.com   1;
    *.example.com 1;
    example.org   2;
    *.example.org 2;
    .example.net  3;
    wap.*         4;
}

解析一下上面

分类:

Nginx

技术点:

相关文章:

  • 2021-07-06
  • 2021-04-07
  • 2021-08-10
  • 2022-01-03
  • 2021-12-02
  • 2021-09-30
  • 2021-08-08
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-10-25
  • 2021-12-30
  • 2021-10-03
  • 2021-04-10
  • 2022-01-15
相关资源
相似解决方案