FAQ

Page Discussion Edit History

RuHttpMapModule

(Redirected from NginxRuHttpMapModule)

Contents

[edit] ngx_http_map_module

袦芯写褍谢褜 ngx_http_map_module 褋芯蟹写邪褢褌 锌械褉械屑械薪薪褘械, 蟹薪邪褔械薪懈械 泻芯褌芯褉褘褏 蟹邪胁懈褋褟褌 芯褌 蟹薪邪褔械薪懈褟 写褉褍谐懈褏 锌械褉械屑械薪薪褘褏. 小芯写械褉卸邪薪懈械 袩褉懈屑械褉 泻芯薪褎懈谐褍褉邪褑懈懈 袛懈褉械泻褌懈胁褘


袩褉懈屑械褉 泻芯薪褎懈谐褍褉邪褑懈懈

map  $http_host  $name  {
: hostnames;

: default          0;

: example.com      1;
*.example.com    1;
: test.com         2;
*.test.com       2;
: .site.com        3;
}

[edit] 袛懈褉械泻褌懈胁褘

  • [#map map]
  • [#map_hash_max_size map_hash_max_size]
  • [#map_hash_bucket_size map_hash_bucket_size]

Template:Anchor

[edit] map

syntax: map $锌械褉械屑械薪薪邪褟1 $锌械褉械屑械薪薪邪褟2 { ... }

default: 薪械褌

context: http

袛懈褉械泻褌懈胁邪 褋芯蟹写邪褢褌 锌械褉械屑械薪薪褍褞, 蟹薪邪褔械薪懈械 泻芯褌芯褉芯泄 蟹邪胁懈褋懈褌 芯褌 蟹薪邪褔械薪懈褟 懈褋褏芯写薪芯泄 锌械褉械屑械薪薪芯泄. 袛懈褉械泻褌懈胁邪 锌芯写写械褉卸懈胁邪械褌 褌褉懈 褋锌械褑懈邪谢褜薪褘褏 锌邪褉邪屑械褌褉邪:

  • default 鈥 蟹邪写邪褢褌 蟹薪邪褔械薪懈械 写谢褟 胁褌芯褉芯泄 锌械褉械屑械薪薪芯泄, 械褋谢懈 蟹薪邪褔械薪懈械 锌械褉胁芯泄 锌械褉械屑械薪薪芯泄 薪械 薪邪泄写械薪芯.
  • hostnames 鈥 褍泻邪蟹褘胁邪械褌, 褔褌芯 胁 泻邪褔械褋褌胁械 懈褋褏芯写薪褘褏 蟹薪邪褔械薪懈泄 屑芯卸薪芯 懈褋锌芯谢褜蟹芯胁邪褌褜 屑邪褋泻褍 写谢褟 锌械褉胁芯泄 褔邪褋褌懈 懈屑械薪懈 褏芯褋褌邪, 薪邪锌褉懈屑械褉,
*.example.com 1; : </code> 袙屑械褋褌芯 写胁褍褏 蟹邪锌懈褋械泄 <code> : example.com 1; *.example.com 1; : </code> 屑芯卸薪芯 懈褋锌芯谢褜蟹芯胁邪褌褜 芯写薪褍 <code> : .example.com 1; :
  • include 鈥 胁泻谢褞褔邪械褌 褎邪泄谢 褋芯 蟹薪邪褔械薪懈褟屑懈. 袙泻谢褞褔械薪懈泄 屑芯卸械褌 斜褘褌褜 薪械褋泻芯谢褜泻芯.

Template:Anchor

[edit] map_hash_max_size

syntax: map_hash_max_size 褔懈褋谢芯

default: map_hash_max_size 2048

context: http

袛懈褉械泻褌懈胁邪 蟹邪写邪褢褌 屑邪泻褋懈屑邪谢褜薪褘泄 褉邪蟹屑械褉 褏褝褕-褌邪斜谢懈褑 写谢褟 锌械褉械屑械薪薪褘褏 map. 袩芯写褉芯斜薪械械 褋屑芯褌褉懈 胁 芯锌懈褋邪薪懈懈 薪邪褋褌褉芯泄泻懈 褏褝褕械泄.

Template:Anchor

[edit] map_hash_bucket_size

syntax: map_hash_bucket_size 褔懈褋谢芯

default: map_hash_bucket_size 32/64/128

context: http

袛懈褉械泻褌懈胁邪 蟹邪写邪褢褌 褉邪蟹屑械褉 泻芯褉蟹懈薪褘 胁 褏褝褕-褌邪斜谢懈褑邪褏 写谢褟 锌械褉械屑械薪薪褘褏 map. 袟薪邪褔械薪懈械 锌芯 褍屑芯谢褔邪薪懈褞 蟹邪胁懈褋懈褌 芯褌 褉邪蟹屑械褉邪 褋褌褉芯泻懈 泻褝褕邪 锌褉芯褑械褋褋芯褉邪. 袩芯写褉芯斜薪械械 褋屑芯褌褉懈 胁 芯锌懈褋邪薪懈懈 薪邪褋褌褉芯泄泻懈 褏褝褕械泄.

[edit] References

Original Documentation