Setup Websockets with Apache Reverse Proxy with SSL

Apache helicopter ; Source: Unsplash

I’ve scratched my head for hours and finally I was able to set it up and make it running.

So my tech stack was .NET Core app for API on docker, SignalR for socket and Apache as a reverse proxy. Everything was working without Reverse Proxy and SSL.

As soon as I’ve setup SSL and reverse proxy, websockets stopped working. So here below is a VirtualHost configuration that I’ve used to forward normal and websockets requests to respective host.

Check the virtualhost code below:

If above embed git is not visible click here https://gist.github.com/technoknol/f21ae396f463e78e431bd89cc41b83ee.

Hope this will help. Enjoy!!!

Shyam has written 29 articles

Shyam is senior full stack developer, who loves to explore new technologies and work on them. He's passionate about coding so can code 24/7. He uses PHP as a backend programming language.

He knows Laravel, MySQL, AngularJS, ReactJS, Redis, Kubernetes, Git, CodeIgniter, PHP, MVC pattern, Lodash, jQuery, VanilaJS, Teamcity and many other technologies and tools.

Shyam writes notes and hacks on his blog (https://shyammakwana.me). In spare time he can be found @ StackOverflow or crafting any new open source application.

Passionate Programmer and Meditator #PERIOD.