我正在尝试将我的网站迁移到更高版本的 nginx(从1.11.13到1.17.5)
在我的/etc/nginx/nginx.conf, 我有:
http {
... other stuff
map_hash_max_size 262144;
map_hash_bucket_size 262144;
map $uri $is_rewrite {
default no_redirect;
include /home/fatpeter/conf/web/chambres.com.extra/links.map;
}
..more stuff
}
此 links.map 文件为 14mb(我知道它很大,但是我们有很多旧的 URL 格式需要 301)
当我重新启动 nginx 时,我得到:
service nginx restart
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
错误出现如下:
Nov 14 11:25:56 admin2.site.com systemd[1]: Starting nginx - high performance web server...
Nov 14 11:25:56 admin2.site.com nginx[21418]: nginx: [emerg] could not build map_hash, too large map_hash_bucket_size: 262144
Nov 14 11:25:56 admin2.site.com systemd[1]: nginx.service: Control process exited, code=exited status=1
有什么变化吗?文档似乎表明它仍然是一个有效的设置