gpt4 book ai didi

Fedora 26 上的 Nginx : could not build optimal types_hash error message

转载 作者:行者123 更新时间:2023-12-02 03:09:20 31 4
gpt4 key购买 nike

当我开始看到此错误时,我已经安装了 Fedora 和 Ngnix,并添加了本地开发的所有配置文件

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
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

我发现解决方案说我应该将 types_hash_bucket_size 添加到 nginx.conf,但我已经添加了它,删除了默认的,删除了两者并添加了两者,它坚持显示此错误。

http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;

# I tried leaving both, removing both and one of each. The error persists.
types_hash_max_size 2048;
server_names_hash_bucket_size 128;
不过,当我安装 nginx 时,

types_hash_max_size 是默认存在的。

来自启用站点的我的文件:

server {
listen 80;
server_name devapi.hporder.com;

root /home/gabriel/Sites/hp-order-system/workspace/api;

client_max_body_size 10M;

location ~ ^/(images|javascript|js|css|flash|media|static)/ {
expires 30d;
}

location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php$is_args$args;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/Cellar/nginx/1.10.1/html;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_param FF_BOOTSTRAP_ENVIRONMENT dev;
fastcgi_param FF_BOOTSTRAP_CONFIG api/dev;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# include /usr/local/etc/nginx/fastcgi.conf;

fastcgi_buffer_size 1024k;
fastcgi_buffers 1024 1024k;
fastcgi_busy_buffers_size 1024k;
}
}

最佳答案

在 Fedora 25 上,我也遇到了这个问题。 types_hash_max_size 设置为 2048(nginx 文档表明它默认为 1024)。我只是将其增加到 4096 并且 nginx 很满意(使用 nginx -t 检查)。

FWIW,在我的配置中没有与哈希桶大小相关的设置。这只是默认值。

关于Fedora 26 上的 Nginx : could not build optimal types_hash error message,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46031491/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com