Re: Can someone explain me why "curl: (7) Failed to connect to 127.0.0.1 port 2000: Connection refused" ?
I solved it . It was mix of small little problems that together hindered the correct answer: - changed in golang webserver HOST = 127.0.0.1 - capitalized the first letter of each element of the Puser struct in order to make it visible to json decoder - used correctly the curl command: curl -d'{"first_name":"pinco", "last_name":"pallo", "company_name":"Company","email":"pinco.pa...@company.com","tel":"1"}' -H "Content-Type: application/json" 127.0.0.1:2000/puser/add [{"First_name":"pinco","Last_name":"pallo","Country":"","Company_name":"Company","Email":"pinco.pa...@company.com","Tel":"1"}] Posted at Nginx Forum: https://forum.nginx.org/read.php?2,288019,288023#msg-288023 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
RE: Can someone explain me why "curl: (7) Failed to connect to 127.0.0.1 port 2000: Connection refused" ?
> Subject: Can someone explain me why "curl: (7) Failed to connect to > 127.0.0.1 port 2000: Connection refused" ? > > Hi!, > > I do not understand why it says "curl: (7) Failed to connect to 127.0.0.1 port > 2000: Connection refused" : > curl -X POST -F 'first_name=pinco' -F 'last_name=pallo' -F > 'company_name=Company' -F 'email=pinco.pa...@company.com' -F > 'tel=1' > 127.0.0.1:2000/puser/add curl: (7) Failed to connect to 127.0.0.1 port 2000: > Connection refused. > > In server-gorillamux.go : CONN_PORT = "2000" Is the go application/server running? Since the nginx doesn't listen on 2000 port (and only proxies the connections to backend) it's important that the backend is up. rr ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx