【发布时间】:2021-02-10 17:13:01
【问题描述】:
首先,这是我用来建立 websocket 连接的技术:
- 用于前端的 Sock JS,带有 STOMP 协议
- NGINX 作为网络代理
- Spring 作为带有 STOMP 协议的套接字服务器
我配置了一个 NGINX 实例,它将代理 Web 套接字请求,到目前为止,这个 NGINX 配置在减去令牌验证后工作正常。
location /wsapp/ {
proxy_pass http://wsbackend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host; }
想要在 NGINX 中验证和终止令牌,但似乎没有找到拦截作为 stomp 标头一部分的令牌的方法。有解决办法吗?
【问题讨论】:
标签: nginx spring-websocket stomp sockjs