Frontend 502 Error - Long queries

I’m using the SimpleJSONDatasource.
With some longer running queries I’m getting this error in the frontend

502 Proxy Error

Proxy Error
The proxy server received an invalid
response from an upstream server.
The proxy server could not handle the request POST /sma/grafana/api/datasources/proxy/11/query.
Reason: Error reading from remote server

Where can I increase that timout event, I need those queries