Ubuntu server 20.04 with reverse Apache proxy
by alexsec from LinuxQuestions.org on (#5DT0K)
Dear Linux friends,
I am working on one project. I have forwarded ports 80, 443, 8189, 8188, 8088, 8989 to Apache proxy server from my router. Now reverse proxy needs to forward requests based on domain name to one of two janus video conference servers running on other machines
Here is my sample of config for one server:
<VirtualHost *:80>
ServerName server1.example.com
ServerAlias server1.example.com
ServerAdmin webmaster@example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost Off
#LogLevel debug
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule .* "ws://janus.optima-apps.rs:8188/$1" [P,L]
ProxyPass / http://10.x.x.x:80/
ProxyPassReverse / http://10.0.0.35:80/
ProxyPassReverse / http://janus.optima-apps.rs:80/
ProxyPass / ws://10.x.x.x:8188/
ProxyPassReverse / ws://10.x.x.x:8188/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
It is not working, Chrome console says unable to connect to 8188 Web socket
Any help would be Greatly Appreciated


I am working on one project. I have forwarded ports 80, 443, 8189, 8188, 8088, 8989 to Apache proxy server from my router. Now reverse proxy needs to forward requests based on domain name to one of two janus video conference servers running on other machines
Here is my sample of config for one server:
<VirtualHost *:80>
ServerName server1.example.com
ServerAlias server1.example.com
ServerAdmin webmaster@example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost Off
#LogLevel debug
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule .* "ws://janus.optima-apps.rs:8188/$1" [P,L]
ProxyPass / http://10.x.x.x:80/
ProxyPassReverse / http://10.0.0.35:80/
ProxyPassReverse / http://janus.optima-apps.rs:80/
ProxyPass / ws://10.x.x.x:8188/
ProxyPassReverse / ws://10.x.x.x:8188/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
It is not working, Chrome console says unable to connect to 8188 Web socket
Any help would be Greatly Appreciated