B4J Question Apache reverse proxy to jetty


Well-Known Member
Licensed User
Longtime User

On my VPS (which has a single IP) I need to use apache2 as a webserver.
Fortunately I succeeded in having it reverse proxy a subdomain (redirecting to a Jetty /B4J webserver running on port 8080) through https:// with a Let's encrypt certificate

However, It won't work with websockets (eg: the chatroom application).

Thanks !

This my vhost file for apache:
<IfModule mod_ssl.c>
<VirtualHost *:443>
 ServerName mydomain
 DocumentRoot /var/www/html
 SSLCertificateFile /etc/letsencrypt/live/mydomain/cert.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/mydomain/privkey.pem
 Include /etc/letsencrypt/options-ssl-apache.conf
 SSLCertificateChainFile /etc/letsencrypt/live/mydomain/chain.pem
 ProxyPreserveHost On
 ProxyPass / ws://
 ProxyPassReverse / ws://


Well-Known Member
Licensed User
Longtime User
Solved it somehow: the above configuration is correct.

However b4j_ws needs to be modified as the port when connecting is not correct: this causes a problem on Edge/IE
Upvote 0