skip to Main Content

I’ve developed a golang web application using the gin gonic framework.
Im using shared hosting and control everything over my the cPanel.
I uploaded the compiled go app and launched it using a custom certificate.

When launching the application I get
[GIN-debug] Listening and serving HTTPS on :3000

Although when I try to visit the website with my domain_name:port it doesn’t work. It just keeps loading forever and nothing happens. Is there any way I can redirect port 80 or 443 to my golang application if that makes sense?

2

Answers


  1. In your Go app you should be able to chose what port your app is listening on:

    router.Run("localhost:443")

    Login or Signup to reply.
  2. Typically cpanel runs on top of apache httpd so port 443 is already taken. Use apache .htaccess file to define the reverse proxy.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search