Proxying Squore Server with Apache
It is possible to use Apache in a proxy/reverse proxy role on top of Squore Server. This approach makes use of the proxy and proxy_wstunnel modules to handle web and websocket traffic between client browsers and Squore Server and is compatible with Apache starting from version 2.4.
For more information about the Apache modules, consult http://httpd.apache.org/docs/2.4/mod/mod_proxy.html and http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html. |
The following configuration can be used to proxy Squore Server traffic in your Apache configuration file:
<VirtualHost *:80>
ServerName squore.example.com
ProxyPass / http://localhost:8180
ProxyPassReverse / http://localhost:8180
<Location />
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://localhost:8180%{REQUEST_URI} [P]
</Location>
</VirtualHost>
These lines of configuration are the minimum required to guarantee that the necessary traffic to and from Squore. For more complex scenarios, including SSL and certificate configuration, refer to official Apache documentation on http://httpd.apache.org/docs/2.4/.