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
阅读 531
阅读 544
阅读 732
推荐阅读
阅读 1,039
阅读 1,099
阅读 1,101
阅读 2,249
阅读 1,667
阅读 1,536
阅读 1,975
阅读 1,894