• 注册
  • 查看作者
  • nginx通过map重定向警告nginx: [warn] could not build optimal map_hash

    警告:

    nginx: [warn] could not build optimal map_hash, you should increase either map_hash_max_size: 2048 or map_hash_bucket_size: 64;

    需要增加这两个参数 是放在server{}之外(网上参考文章说放http{}中)

    示例

    #修复报错
    map_hash_max_size 2048;
    map_hash_bucket_size 64;
    #301重定向a
    map $request_uri $new_uri {
      include /www/wwwroot/xxxx.com/article-301-a.map; 
    }

    如果map较大需要增加这两个值

    广东·深圳
  • 0
  • 0
  • 0
  • 106
  • 请登录之后再进行评论

    登录
  • 发布
  • 偏好设置
  • 单栏布局 侧栏位置: