nginx: [emerg] unknown "connection_upgrade" variable

前端之家收集整理的这篇文章主要介绍了nginx: [emerg] unknown "connection_upgrade" variable前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Nginx代理websockt,其中涉及到了一个Nginx的设计问题 End-to-end and Hop-by-hop Headers
需要添加map配置,map在Nginx中是为一个或多个变量设置映射表

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

server {
location / {

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }
}

}

原文链接:https://www.f2er.com/note/411466.html

猜你在找的程序笔记相关文章