Yes. I later figured it out after a lot of research.

Thanks to this link:
https://www.datadoghq.com/blog/nginx-502-bad-gateway-errors-gunicorn/
*AJAYI Sunday *
(+234) 806 771 5394
*sunnexaj...@gmail.com <sunnexaj...@gmail.com>*



On Tue, Jul 7, 2020 at 1:46 AM Dan Madere <danmad...@gmail.com> wrote:

> Sounds like nginx is timing out waiting for Django, due to the slow query.
> You can set proxy_connect_timeout and proxy_read_timeout in your nginx
> config to allow it to wait longer. Another approach would be to optimize
> the SQL query and add indexes, to have the query run faster and not cause
> the timeout.
>
> Dan
>
> On Monday, July 6, 2020 at 9:24:48 AM UTC-4 sunne...@gmail.com wrote:
>
>> I get this error from my postgresql log also : could not send data to
>> client: Broken pipe
>> *AJAYI Sunday *
>> (+234) 806 771 5394 <+234%20806%20771%205394>
>> *sunne...@gmail.com*
>>
>>
>>
>> On Mon, Jul 6, 2020 at 2:06 PM Sunday Iyanu Ajayi <sunne...@gmail.com>
>> wrote:
>>
>>> I have a database sql function that I am running fine when on the
>>> database but once i link the output via an api I created  and test via
>>> postman, I get Nginx 502 error and on my postgresql log I get : Çonnection
>>> Timeout error.
>>>
>>> The sql db function link to a foreign table and pulls some data (between
>>> 500-2000 rows)
>>>
>>> Please how can I fix this?
>>>
>>>
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394 <+234%20806%20771%205394>
>>> *sunne...@gmail.com*
>>>
>>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9a815404-3c51-4a1f-b85d-ba6886dfc9a0n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9a815404-3c51-4a1f-b85d-ba6886dfc9a0n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKYSAw2w16jsuSPt%3D6UxV4GupAPq2HCFWBi%2BvsJYS_kH%3DwQ5WA%40mail.gmail.com.

Reply via email to