Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have spun up a Fedora box, and am running a golang server at port 8080. I am trying to setup nginx reverse proxy on that application so that I can access it through port 80.
If you want to skip reading the whole question, here’s the error:
2019/07/27 05:50:46 [crit] 4186#0: *1 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: <MY IP>, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "<DROPLET IP>"
I have a really minimal golang app:
package main
import (
"fmt"
"net/http"
)
func helloWorld(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, you requested: %s\n", r.URL.Path)
}
func main() {
http.HandleFunc("/", helloWorld)
http.ListenAndServe(":8080", nil)
}
At this point when I run go run main.go, I can go to port 8080 and see the response (it’s 200).
I have a default nginx.conf with following modifications.
server {
listen 80;
server_name _; # I have tried changing this to my droplet IP as well
root /usr/share/nginx/html;
location / {
proxy_pass http://127.0.0.1:8080;
}
# Followed by the default error handing
}
The response I’m getting back is 502 Bad Gateway.
What might be wrong?
Roger Henman
Roger Henman
Paul Adeyenuwo
wtrenker
Popescu Crina-Mariana
Setor Blagogee
daniel.carpenter01
Morzaram
Sai Aung Kaung Myat
alenn
Jake W