当为 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 ×1