Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicokaiser/nginx-websocket-proxy
nginx WebSocket Proxy
https://github.com/nicokaiser/nginx-websocket-proxy
Last synced: 5 days ago
JSON representation
nginx WebSocket Proxy
- Host: GitHub
- URL: https://github.com/nicokaiser/nginx-websocket-proxy
- Owner: nicokaiser
- License: mit
- Created: 2014-03-15T21:59:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-26T00:33:26.000Z (over 3 years ago)
- Last Synced: 2024-08-02T15:54:55.097Z (3 months ago)
- Size: 97.7 KB
- Stars: 344
- Watchers: 15
- Forks: 97
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# nginx WebSocket Proxy
As of version 1.4, nginx is capable of forwarding WebSocket requests, so it can be used as a reverse proxy for HTTP, HTTPS, WS and WSS.
Here are some simple example configuration snippets for WebSocket forwarding in nginx.
## Requirements
* nginx 1.4.x or higher
* WebSocket and HTTP server running on `ws|http://localhost:8080`This is a typical scenario given by [Engine.IO](https://github.com/LearnBoost/engine.io), [Socket.IO](https://github.com/LearnBoost/socket.io), [Primus](https://github.com/primus/primus), etc. which provide a WebSocket server with HTTP fallback.
## Example Configs
* [Simple WebSocket Proxy](simple-ws.conf) – forwards WS and HTTP requests to `ws|http://localhost:8080`
* [WebSocketSecure Proxy](simple-wss.conf) – forwards WSS and HTTPS requests to `ws|http://localhost:8080`
* [WebSocket Proxy with Path Rewriting](path-rewriting.conf) – forwards `wss|https://ws.example.com/services/myservice` to `ws|http://localhost:8080`
* [WebSocket Proxy with Load Balancing](load-balancing.conf) – like previous example, but with three backend servers, with one client always being forwarded to the same backend## See Also
* http://nginx.org/en/docs/http/websocket.html
* [Nginx Server Configs](https://github.com/h5bp/server-configs-nginx) – Great resource for nginx server config documentation## Author
**Nico Kaiser**
+ http://twitter.com/nicokaiser
+ http://kaiser.me
+ http://github/nicokaiser## License
[MIT License](LICENSE.md)