Elvis Detters
Elvis Detters

Reputation: 51

Hosting Golang Application on Cpanel

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?

Upvotes: 0

Views: 1813

Answers (2)

Jamy Spencer
Jamy Spencer

Reputation: 11

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

Upvotes: 0

Des
Des

Reputation: 1

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

router.Run("localhost:443")

Upvotes: 0

Related Questions