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:, server:, request: “POST / HTTP/1.1”, upstream: “”, host: “”, referrer: “

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.