Ubuntu 16.04
Sponsored Link

mod_proxy_wstunnel Settings2016/06/15

 
Enable mod_proxy_wstunnel module to set WebSocket Proxy.
[1] For example, configure Apache2 to set proxy on /chat for an application which listens on localhost:1337. The sample application is from here (section [3]).
root@www:~#
a2enmod proxy proxy_http proxy_wstunnel

root@www:~#
vi /etc/apache2/mods-enabled/proxy.conf
# add between <IfModule mod_proxy **> - </IfModule>

<IfModule mod_proxy.c>
    ProxyRequests Off
    <Proxy *>
        Require all granted
    </Proxy>

    ProxyPass /socket.io/ http://127.0.0.1:1337/socket.io/
    ProxyPassReverse /socket.io/ http://127.0.0.1:1337/socket.io/

    ProxyPass /chat http://127.0.0.1:1337/
    ProxyPassReverse /chat http://127.0.0.1:1337/

root@www:~#
systemctl restart apache2
  Access to the sample App to make sure it works normally on proxy environment.
Matched Content