SeductiveApps.com
SeductiveApps.com

Reputation: 31

NGINX : upstream timed out (110: Connection timed out) but not when URL queried directly

i'm using Ubuntu 20.04 to host a number of websites, and i'm using nginx as a gateway server to my apache webserver.

the problem i'm facing is that my website won't load one of it's components that's loaded up by the javascript it loads (via AJAX from jQuery). it's the loading of a simple list of background URLs as JSON data, that should normally take under a second. And it does, when queried directly in the browser. But it won't load at all when loaded up by the HTML + Javascript of the website itself. :(

/etc/nginx/sites-enabled/00-default-ssl.conf :

    # HTTPS iRedMail 
server { 
        listen 443 ssl http2; 
        listen [::]:443 ssl http2; 
        server_name mail.mydomain.com; 
        root /var/www/html; 
 
    index index.php index.html; 
 
    include /etc/nginx/templates/misc.tmpl; 
    include /etc/nginx/templates/ssl.tmpl; 
    include /etc/nginx/templates/iredadmin.tmpl; 
    include /etc/nginx/templates/roundcube.tmpl; 
    include /etc/nginx/templates/sogo.tmpl; 
    include /etc/nginx/templates/netdata.tmpl; 
    include /etc/nginx/templates/php-catchall.tmpl; 
    include /etc/nginx/templates/stub_status.tmpl; 
} 
 
# HTTPS my own server 
server { 
    listen 443 ssl http2; 
    listen [::]:443 ssl http2; 
    server_name mydomain.com; 
        #root /home/myrealname/data1/htdocs/nicer.app; 
 
  ssl_certificate /home/myrealname/data1/certificates/other-ssl/all.crt; 
  ssl_certificate_key /home/myrealname/data1/certificates/other-ssl/mydomain.com.key; 
 
  ssl on; 
  ssl_session_cache shared:SSL:10m; 
  ssl_session_timeout 10m; 
  ssl_protocols TLSv1.2 TLSv1.1 TLSv1; 
  ssl_ciphers 'kEECDH+ECDSA+AES128 kEECDH+ECDSA+AES256 kEECDH+AES128 kEECDH+AES256 kEDH+AES128 kEDH+AES256 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !kECDH !DSS !MD5 !RC4 !EXP !PSK !SRP !CAMELLIA !SEED'; 
  ssl_prefer_server_ciphers on; 
  ssl_dhparam /etc/nginx/dhparam.pem; 
 
  location / { 
    proxy_pass https://192.168.178.55:444/; 
    proxy_redirect off; 
    proxy_buffering off; 
    proxy_set_header Host $host; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header X-Forwarded-Ssl on; 
 
  proxy_connect_timeout 159s; 
  proxy_send_timeout   60; 
  proxy_read_timeout   60; 
  send_timeout 60; 
  resolver_timeout 60; 
  } 
}

/etc/apache2/sites-enabled/00-default-ssl.conf is your typical ssl enabled apache config, serving a VirtualHost on *:444.

UPDATE : the problem appears to be independent of running php7.4-fpm eithe on unix sockets or on a unix port, or plain apache2 with SSL and PHP enabled.

UPDATE2 : the problem is caused by multiple AJAX requests coming from the javascript at the same time, something which is largely beyond my control to fix.

Upvotes: 2

Views: 943

Answers (3)

SeductiveApps.com
SeductiveApps.com

Reputation: 31

one of the things my webpage does is load up JSON data from a couchdb server, which i necessarily serve with SSL.

in all the confusion, i had forgotten to re-enable the nginx forward to couchdb http (not https). simply copying it's config file from /etc/nginx/sites-enabled.bak/couchdb to /etc/nginx/sites-enabled/couchdb.conf fixed all my problems :)

Upvotes: 0

Rene Veerman
Rene Veerman

Reputation: 27

the data you request, is it filtered by PHP? if so, which PHP and Apache are you using? The plain vanilla, or php-fpm?

Upvotes: 1

Rene Veerman
Rene Veerman

Reputation: 27

please check if you can load the direct URL while the website loads

Upvotes: 1

Related Questions