502 Error Bad Gateway GraphQL API

Hi, i am trying to integration a third party app with ERPNext which use a GraphQL API. When sending mutation to the API i am getting 502 Error BAD Gateway from NGINX. I Know the error is from my side because when trying to query the API from a jupyter notebook all is working properly.
Do you have any idea how can i fix this issue