Nginx error while fil uploading via form inGolang application

I have configured Nginx for go application on digitalocean droplet and this is my problem

I have a form through which i’m uploading files when I use command go run main.go everything works fine and form submission becoomes successful

But when I run my compiled binaries entire site is working except that form I’m getting 502 bad gateway error please help

this is what i got in error log of nginx

2018/05/27 05:36:56 [error] 16948#16948: *1 upstream prematurely closed connection while reading response header from upstream, client: 14.192.54.60, server: cutfat.in, request: “POST / HTTP/1.1”, upstream: “http://127.0.0.1:8080/”, host: “cutfat.in”, referrer: “https://cutfat.in/

Do you have any logs from your go binary? If you check with ps, is the process there?

1 Like

Problem got solved I was using sendgrid API and required enviroment variables were declares in .profile file

But for compiled go program I have included that in .service file itself and now everything is working fine

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