解决Nginx 错误“could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size”

Published on Aug. 22, 2023, 12:11 p.m.

错误如下

could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size

解决方案:
修改如下

# /etc/nginx/nginx.conf
http {
    types_hash_max_size 4096;
    server_names_hash_bucket_size 128;
    ...
}

测试

nginx -t

重启查看状态

sudo systemctl restart nginx
sudo systemctl status nginx

参考链接

https://wiki.archlinux.org/title/nginx

https://stackoverflow.com/questions/46031491/nginx-on-fedora-26-could-not-build-optimal-types-hash-error-message

Tags: