Skip to content
本页目录

遇到问题

宝塔迁移或者修改Nginx配置文件保存时遇到报错

nginx: [emerg] unknown “connection_upgrade“ variable

解决方法

在nginx配置文件中nginx.conf配置文件中添加map如下:

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

插入位置http配置中:

http
    {
        include       mime.types;
		    #include luawaf.conf;

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

		    include proxy.conf;

        default_type  application/octet-stream;
        server_tokens off;
        access_log off;
        ......

server
    {
        listen 888;
        server_name phpmyadmin;
        index index.html index.htm index.php;
        ......
    }
include /www/server/panel/vhost/nginx/*.conf;
}

Released under the Apache License 2.0