By paulge8
I have a web application that uses a WebSocket connection. I set up a Ubuntu droplet and configured Apache and Tomcat. My application was working fine until I tried to setup SSL. I followed the instructions to get an SSL certificate, and followed the instructions in the following post to set up the Reverse Proxy with Apache: How To Encrypt Tomcat 8 Connections with Apache or Nginx on Ubuntu 16.04 Now, SSL works fine, but it complains that you can not start a ws:// from an HTTPS connection. So I tried changing the call from ws:// to wss://, but the WebSocket will not connect, because it can’t properly upgrade the protocol from https to wss.
I am relatively new to the unix world, and am not familiar with all of the Apache and Tomcat configuration parameters. Can someone please let me know exactly what I need to configure to get Apache to properly proxy the wss to Tomcat, and/or what Tomcat configurations I need to make to get a secure websocket working with this Reverse Proxy setup?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This question was answered by @hansen:
@paulge8 I’m just leaving a comment, since I don’t know the exact configuration of Apache, but in Nginx you would add the following to the
location:proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_http_version 1.1;From what I remember in Apache, you need to enable the module
mod_proxy_wstunnelhttps://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.htmlIf it still doesn’t work, then please add error logs from Apache and what error the browser console states.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.