如下圖所示,在瀏覽器輸入ws域名的時候,如何讓其不顯示workerman版本相關(guān)信息,感覺有些敏感,ws服務(wù)端功能什么的都正常,就是不想顯示這個信息。
在nginx加 2~4行就行了
location ^~ / {
if ($http_upgrade != "websocket") {
return 403; # 攔截非 WebSocket 請求
}
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
if (!-f $request_filename){
proxy_pass http://ws;
}
}