Proxy websocket wss:// to ws:// apache

后端 未结 6 757
自闭症患者
自闭症患者 2021-02-02 02:15

i searched alot but i couldnt connect my websocket to wss:// , i found that there is a way to proxy wss://domain.com:9090 and apache apply the proxy on it and redirect request

6条回答
  •  终归单人心
    2021-02-02 02:25

    The /websocket path is missing in your ProxyPass configuration path.

    Use:

    ProxyPass /websocket ws://example.com:9090/websocket
    ProxyPassReverse /websocket ws://example.com:9090/websocket
    

    Additional information: Like others mentioned, you have to uncomment the line:

    LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

    If you are also using a http ProxyPass thats relative path is "/" (forwarding everything directly), the specific "/websocket" path configuration must be configured first, otherwise "/" grabs first.

    ProxyPass /websocket ws://example.com:9090/websocket
    ProxyPassReverse /websocket ws://example.com:9090/websocket
    
    ProxyPass balancer://ac-cluster/
    ProxyPassReverse / http://example.com:9090
    

提交回复
热议问题