Problem trying to run Golang with Apache2 as a reverse proxy server

I have been trying without success for the past few days to get Golang to work on an Apache2 server running Ubuntu 14.04

I believe Localhost Golang applications can be uploaded to an Apache2 server running as a reverse proxy.

I have Golang installed locally and created numerous Golang applications.

I have managed to get http://localhost:8080 to run the Golang http.go application but cannot progress pass this point.

####Tutorials followed


Has anyone managed to get Golang running on Apache2? If so I would be grateful for a link to a tutorial.

Hi John,

Can you also get your application running on the remote server on port 8080?

I am unable to get the remote Apache2 server on port 8080 to work. I think this is because a reverse proxy server is required.

I have read that once the reverse proxy is working, Localhost compiled Golang source code can be uploaded to the remote server.

It is not necessary to install Golang on the remote server.

If your program runs on the remote server, you should be able to access it via the server’s IP (e.g. unless the server configuration blocks that port.

I managed to set up Apache2 to proxy to a golang app by doing the following:

  • Install the proxy and proxy_http modules (e.g. sudo a2enmod proxy on an Ubuntu server)
  • Add the virtual host configuration (see below)
  • Restart apache2

The VirtualHost settings:

<VirtualHost *:80>
  ProxyPass /


Many thanks for your script.

It is not doing exactly what is required but at least it is producing output. This is far better than what I had before which was a blank screen and no access or error logs.

It is rather later here and have had enough for one day. I hope to try again tomorrow.

No worries. If you want, just let me know what it is you’re trying to achieve and I can try that out on my setup and see if I can figure it out :slight_smile:

1 Like

I tied myself in knots with the Apache2 Reverse Proxy. I managed to get it to reverse proxy to localhost and to my other sites but do not understand how to use the facility :frowning:

I installed Golang on the remote server and now the sites are calling a compiled Golang executable:





Delighted to say the speed tests are exceptional for a first attempt, about 50ms!!!

Google Analytics was taking nearly four times as long to load than the rest of the page so I have temporarily disabled until I can find why it is so slow.

…to be continued

…to be continued

I managed to solve the multiple Apache2 Reverse Prosy problem by using CaddyServer and they utilise the Free Automatic Https Protocol which was recently released late December 2015.

Golang is interesting but for me it is hard-work :frowning: According to a blog, it takes about three-months before it starts to make sense and then it becomes productive.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.