Reverse proxy with websocket mod_proxy_wstunnel

后端 未结 1 647
一整个雨季
一整个雨季 2021-01-02 03:26

I have a problem with the web sockets and my reverse proxy Apache, I have upgraded in latest release 2.4.5 and loaded the module mod_proxy_wstunnel.

The

相关标签:
1条回答
  • 2021-01-02 04:22

    This line:

    ProxyPass /my_app/BasicWebsocketServlet ws://1X.X.X.1:8080/my_app/BasicWebsocketServlet retry=0
    

    needs to come before this one:

    ProxyPass /my_app  http://1X.X.X.1:8080/my_app
    

    Explanation (from https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass):

    Ordering ProxyPass Directives

    The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins. So usually you should sort conflicting ProxyPass rules starting with the longest URLs first. Otherwise later rules for longer URLS will be hidden by any earlier rule which uses a leading substring of the URL. Note that there is some relation with worker sharing. In contrast, only one ProxyPass directive can be placed in a Location block, and the most specific location will take precedence.

    For the same reasons exclusions must come before the general ProxyPass directives.

    0 讨论(0)
提交回复
热议问题