我正在尝试在开发工作流程中使用 NGINX 作为反向代理。但是,每当我停止或重新启动服务器时,我都会收到此警告:
nginx: [warn] could not build optimal types_hash, you should increase either types_hash_max_size: 2048 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size
我尝试将 types_hash_max_size 设置为 2048 和 4096,将 types_hash_bucket_size 设置为 64 和 128,将 server_names_hash_bucket_size 设置为 128。我尝试将这些设置放在 http、服务器和位置上,但没有成功。
这是我的配置文件:
http {
server {
listen 8080;
listen [::]:8080;
server_name localhost;
location / {
proxy_pass http://example.com/;
}
}
server_names_hash_bucket_size 128;
types_hash_max_size 4096;
types_hash_bucket_size 128;
}
events {}
我的环境:
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description: Fedora release 27 (Twenty Seven)
Release: 27
Codename: TwentySeven
$ nginx -v
nginx version: nginx/1.12.1
另外,我以这种方式运行 NGINX:
$ sudo nginx -p `pwd` -c proxy.conf