小编J H*_*J H的帖子

当设置Nginx的配置文件时,$host和$http_upgrade是什么意思?

当为 nginx 设置一个应该运行使用 WebSockets 的网站的配置文件时,所有教程都说要使用这个:

location /wsapp/ {
    proxy_pass http://websiteName;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
}
Run Code Online (Sandbox Code Playgroud)

$host 和 $http_upgrade 到底是什么?它们是需要替换的伪变量吗?

nginx

8
推荐指数
1
解决办法
7448
查看次数

标签 统计

nginx ×1