亲测:nginx: [emerg] unknown “connection_upgrade” variable

服务器 0

问题

nginx启动或者重启提示信息如下:

nginx: [emerg] unknown "connection_upgrade" variable
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed

解决方法

在nginx配置文件http标签下添加如下几行:

    map $http_upgrade $connection_upgrade {           default upgrade;           ''      close;       }

Ps:主配置文件yum安装默认路径为/etc/nginx/conf/nginx.conf

也许您对下面的内容还感兴趣: