server {
listen 80;
server_name www.xxxx.com;
#只接受GET,POST请求
if ($request_method !~* GET|POST) {
return 403;
}
charset utf-8;
location / {
proxy_pass http://localhost:8080;
# 以下支持 WebSocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
Nginx 1.20配置多域名及WebSocket
阅读 403
阅读 409
阅读 552
推荐阅读
阅读 1,342
阅读 1,464
阅读 1,198
阅读 1,430
阅读 3,151
阅读 1,169
阅读 1,650
阅读 669