How to host a websocket in Hestia

Hi, during the last days I have been doing some research about how to properly host a websocket sever. I’m still learning from PHP and I can consider myself as a beginner with Hestia.
First, let’s explain a little bit my context:
I have a website (written in PHP) that basically is waiting for a message broadcasted in a websocket server. The website is published correctly, but I do not know how to publish or host the websocket server.
Whenever I run the server (with php ws-server.php), the clients seem to no recongnize the host or port. I have found that I might have to modify some Apache/nginx configuration, but I do not have any idea of how to…
I have also tried to run the ws-server.php (the websocket server file) with supervisord, as the library used (Ratchet, a websocket library for php) recommends (but they skip the part of Apache / Nginx configuration).

And also, I do not know if the “backend template” should be in “socket” or that means another thing.

To sum up, I would like to host a website under the same domain, and a websocket server at port 8080 (preferably 8080, but if needed can be modified with no problem).

The idea would be:
web hosted: example.com/
and the websocket available at: wss://example.com:8080

Learn from other application how the use nginx to using websocket
proxy_set_header Connection “Upgrade”;
proxy_set_header Host $http_host;
is for websocket

 # main websocket
 location ~ ^/cool/(.*)/ws$ {
   proxy_pass http://127.0.0.1:9980;
   proxy_set_header Upgrade $http_upgrade;
   proxy_set_header Connection "Upgrade";
   proxy_set_header Host $http_host;
   proxy_read_timeout 36000s;
 }