I am trying to setup a server for a Socket.IO game, but we will also have a little landing page in php served through Apache.
I managed to make the server work by doing a proxy from Apache to the Socket.IO app. Apache is running on :80 and node on :8080, which will be closed to the public. The proxy is done on a subdirectory from apache. The configuration is as follows:
<VirtualHost *:443>
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
ServerAdmin XXXXX
ServerName XXXXX
DocumentRoot /var/www/html/XXXXX
ErrorLog /var/log/error.log
CustomLog /var/log/access.log combined
SSLCertificateFile XXXXX
SSLCertificateKeyFile XXXXX
Include XXXXX
SSLCertificateChainFile XXXXX
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:8080/$1 [P,L]
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
ProxyPass /game http://localhost:8080 retry=0
ProxyPassReverse /game http://localhost:8080
ProxyPass /socket.io http://localhost:8080/socket.io
ProxyPassReverse /socket.io http://localhost:8080/socket.io
</VirtualHost>
</IfModule>
Now, my question is as follows:
Will this affect performance, and is it possible that the rewrite rule for apache will be too much for it to handle for, let's say, at most maybe 10k players?
If it might, is there another better choice for the configuration?