[error] 18#18: *72 upstream timed out (110: Connection timed out)

rodrigobuch nginx-forum at forum.nginx.org
Sun May 24 16:20:27 UTC 2020

I have received this error whenever I try to generate large reports with my
App in PHP.
It does not end the generation and ends the connection by not downloading

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log debug;
pid        /var/run/nginx.pid;

events {
    worker_connections  2048;

http {
    server_names_hash_max_size 512;
    server_names_hash_bucket_size 128;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request"
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;
#    access_log off;

    sendfile        on;
    #tcp_nopush     on;
    client_body_buffer_size 800M;
    client_max_body_size 400M;
    keepalive_timeout  120;
    keepalive_requests 2048;
    #gzip  on;

    # Enable Cache Support
#    proxy_cache_path /data/nginx/cache/app levels=1:2 keys_zone=STATIC:10m
    proxy_cache_path /data/nginx/cache/app levels=1:2 keys_zone=app:10m
max_size=2g inactive=60m use_temp_path=off;

    real_ip_header    X-Forwarded-For;
    real_ip_recursive on;
    proxy_buffers 16 16k;  
    proxy_buffer_size 16k;
    proxy_connect_timeout       300000;
    proxy_send_timeout          300000;
    proxy_read_timeout          300000;
    send_timeout                300000;
    include /etc/nginx/conf.d/*.conf;

    server {
	listen 8081;
	large_client_header_buffers 4 128k;
        location / {
        location /server_status {

server {
  listen 80;
  server_name teste.exemple.com.br;
  gzip on;
  gzip_vary on;
  gzip_comp_level 4;
  gzip_types text/plain text/css text/javascript application/x-javascript
text/xml application/xml;
  gzip_min_length 1400;
  server_tokens off;
  add_header X-Content-Type-Options nosniff;
  proxy_hide_header X-Powered-By;
  client_header_timeout 5s;
  client_body_timeout 5s;
  location / {
    proxy_pass http://prd_exemple_teste;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_http_version 1.1;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_connect_timeout 60s;
    proxy_send_timeout 60s;
    proxy_read_timeout 60s;
    send_timeout 60s;

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,288113,288113#msg-288113

More information about the nginx mailing list