0

I have setup nginx as my api calls.

There is an API call which require to reponse 6-8 minutes to do calulcation and reponse to the API but nginx throw 504 Proxy Timeout.

I need max unlimited reponse timeout for proxy_read_timeout.

How can I achive this.?

I know I am doing wrong to set unlimited time for the proxy server and some time make reach max connection to nginx max open connection.

Browser make this call one time and wait till response and there is one user have access to this API.

Here is my Nginx Config (Angualr + API)

server {
    listen 80;
    server_name  localhost;

    client_max_body_size 500m;
    proxy_read_timeout 360s;

    location /api {
        rewrite /api/(.*) /$1  break;
        proxy_pass          http://api-server:80; # API Server Reidrect
        proxy_redirect      off;
        proxy_set_header    Host $host;
    }

    location / {
        root   /usr/share/nginx/html;
        try_files $uri $uri/ /index.html; # Angualr Redirect
        index  index.html index.htm;
    }

}
Ankur Loriya
  • 105
  • 1
  • 6

0 Answers0