HAProxy is another option for serving Telebugs
over HTTPS with your own TLS certificate. It can also act as a reverse proxy,
similar to Nginx.
When prompted to enter your domain during the telebugs setup
command,
leave it empty and press Enter
. This configures Telebugs to run
on http://localhost:5555 without TLS, allowing HAProxy to manage the
certificate.
apt-get update apt-get install haproxy
frontend https_frontend bind *:443 ssl crt /path/to/your/certificate.pem mode http option httplog default_backend telebugs_backend backend telebugs_backend mode http server telebugs_server localhost:5555 check option http-server-close http-request set-header X-Forwarded-Proto https http-request set-header X-Forwarded-For %[src] http-request set-header X-Forwarded-Host %[req.hdr(Host)] http-request set-header X-Real-IP %[src]
Note: The certificate.pem file should contain your TLS certificate and private key concatenated together. If you’re using Let’s Encrypt, you can concatenate them like this:
cat fullchain.pem privkey.pem > /etc/ssl/private/certificate.pem
haproxy -c -f /etc/haproxy/haproxy.cfg systemctl restart haproxy
Once completed, HAProxy will handle your custom certificate and securely forward traffic to Telebugs on http://localhost:5555. This setup gives you the flexibility to use your preferred TLS certificates.