Then you would need to configure a reverse proxy, preferably with SSL. You can obtain a free SSL certificate from letsencrypt (be sure to donate if possible). Below is a sample nginx config -
```nginx
```nginx
upstream chat {
server 127.0.0.1:8080;
}
@ -53,43 +53,55 @@ server {
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = chat.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = www.chat.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
listen [::]:80;
server_name chat.example.com;
return 404; # managed by Certbot
}
```
Place the file in ```bash /etc/nginx/sites-available/``` (depending on your linux distro this may differ).