I have an nginx configuration that redirects to a Django rest service (Through gunicorn).
Everything works correctly, but when the response is too big (takes more than 30s to respond) I'm getting a 503 service unavailable error. I am sure it is because of this issue because it works correctly on other requests, and only on specific requests where the response is too big (and fetching the request from a third party api) takes too long.
Below is my nginx configuration :
server {
listen www.server.com:80;
server_name www.server.com;
client_max_body_size 200M;
keepalive_timeout 300;
location /server/ {
proxy_pass http://127.0.0.1:8000/;
proxy_connect_timeout 120s;
proxy_read_timeout 300s;
client_max_body_size 200M;
}
location / {
root /var/www/html;
index index.html index.htm;
}
}
I am sure the issue is from Nginx and not gunicorn, because if i do a curl from inside the machine i get a response.
Thanks,