openwares.net

Freedom & Beauty

  • Home
  • About
  • Tags
  • Categories
  • Archives
  • Search
  • Table of Contents
  • Overview

openwares

open source and free matters
993 posts
18 categories
42 tags
0%

nginx反向代理websocket

Posted on 2015-11-05 Edited on 2025-05-19 In GNU/Linux

配置文件中添加如下行:

1
2
3
4
5
6
7
8
9
10
11
12
server {
...
location /wsapp/ {
proxy_pass http://wsbackend;

# proxy websocket reverse
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
...
}

References:
[1]NGINX as a WebSocket Proxy

===
[erq]

# Nginx
Gradle SSH Plugin reject HostKey问题
Untitled Post - 154
© 2025 openwares
Powered by Hexo & NexT.Muse