my website returns 500
My website returns Internal Server Error. when i run "sudo tail -f /var/log/nginx/error.log" it says:
*8 upstream timed out (110: Connection timed out) while reading response header from upstream
*8 connect() failed (111: Connection refused) while connecting to upstream
*8 no live upstreams while connecting to upstream,
*1 connect() failed (111: Connection refused) while connecting to upstream
I have tried eeverything I can to ensure the site displays but returns Internal Server Error. Please your help will be very much appreciated.
in sites-enabled:
server {
server_name www.test.com test.com;
location /static {
alias /home/mike/online_school/online_school/static;
}
location / {
proxy_pass http://localhost:8000;
include /etc/nginx/proxy_params;
proxy_redirect off;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.test.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.test.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.test.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.test.com;
return 404; # managed by Certbot
}
1 Reply
I did a quick Google search of the timeout message that you posted:
*8 upstream timed out (110: Connection timed out) while reading response header from upstream
I found a post on Stack Overflow that has several responses for ways to address this, both in configuration changes or further digging to address a more thorough root cause:
NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream