# proxy\_headers\_hash\_max\_size

<mark style="color:blue;">**proxy\_headers\_hash\_max\_size**</mark>指令用于<mark style="color:blue;">**配置存放HTTP报文头的哈希表的容量**</mark>，其语法结构为：

```nginx
proxy_headers_hash_max_size size;
```

其中，<mark style="color:blue;">**size**</mark>为HTTP报文头哈希表的容量上限，默认为512个字符。

**Nginx服务器为了能够快速检索HTTP报文头中的各项信息**，比如服务器名称、MIME类型、请求头名称等，**使用哈希表存储这些信息**。Nginx服务器在**申请**存放HTTP报文头的空间时，通常以固定大小为单位申请，该大小由[proxy\_headers\_hash\_bucket\_size](https://bohans.gitbook.io/devops/ngnix/ji-chu-zhi-shi/4.-nginx-fu-wu-qi-de-dai-li-fu-wu/4.3-nginx-fu-wu-qi-de-fan-xiang-dai-li-fu-wu/fan-xiang-dai-li-de-ji-ben-she-zhi-de-21-ge-zhi-ling/proxy_headers_hash_bucket_size "mention")指令配置。
