Source: hackingandslacking.com

Deploy a Golang Web Application Behind Nginx

Category: Deployment, Ubuntu, nginx, github

We started last week strong with a foray into Golang, where we created a simple web app serving a “Hello world” route. For those of you who were enticed by this deviation from our regular programming, the next logical question you might have could be how to make this knowledge “useful” by making it accessible by other human beings. We’re going to build on our Golang momentum from last week to do just that: deploy a web application written in Go to a Linux host such as Ubuntu.

We’ll download this to our /tmp folder, build the source, and move the built source to where it belongs: Build Go from source.

We’re going to create a service for our Go app to make sure our app is always running, even if our server is restarted: The syntax for Linux services follows the .ini file format.

Related Articles