榆木 大佬有话说 :
根据header做反向代理
location / {
set $flagv2 0;
if ($http_sec_websocket_version = 13){
set $flagv2 "${flagv2}1";
}
if ($http_sec_websocket_key != ""){
set $flagv2 "${flagv2}1";
}
if ($flagv2 = "011"){
proxy_pass http://yourblog.com ;
}
if ($flagv2 != "011"){
proxy_pass https://www.baidu.com;
}
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
}
浏览器正常访问到 baidu.com ,某工具访问到 yourblog.com
雪丫鬟 大佬有话说 :
厉害了,我都没见过
172721404 大佬有话说 :
011究竟是个啥 我看判断了两次
172721404 大佬有话说 :
http_sec_websocket_key 弱弱的问句这个参数是搞什么用的
kin9 大佬有话说 :
两次flagv2 = "011":o