Go服务器拒绝EBS工作层上SQS的cronJob生成的消息

I am currently trying to deploy a golang package to AWS ElasticBeanstalk, that will be generating SQS messages via a cron.yaml. When im pulling the logs from my app it shows that my go app is refusing the POST request by SQS.

/var/log/nginx/error.log:

*156 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "POST /runTask HTTP/1.1", upstream: "http://127.0.0.1:5000/runTask", host: "localhost"

/var/log/nginx/access.log:

[14/Jul/2019:19:15:00 +0000] "POST /runTask HTTP/1.1" 502 173 "-" "aws-sqsd/2.4" "-"

I currently have the environment running all the default settings provided by EBS. I noticed that EBS put the ec2 instance inside my database VPC but i dont think thats causing the trouble.

Here is the code that the go server is running:

application.go:

func buildHandler(res http.ResponseWriter, req *http.Request) {
    go run()
    res.WriteHeader(http.StatusOK)
    res.Write([]byte(""))
}

func main() {
    http.HandleFunc("/runTask", buildHandler)
    http.ListenAndServe(":5000", nil)
}

cron.yaml:

version: 1
cron:
  - name: "Run Build task"
    url: "/runTask"
    schedule: "*/5 * * * *"

Im fairly new to the whole AWS stack and I would love to hear what i am missing or why this doesnt work the way i expect it to.