How does nginx + django refresh the web page automatically when nginx502?

configure a website with nginx + django. There are a lot of requests for the website. There will be 502 bad every time you refresh the page dozens of times. If you want to use a temporary solution, when the nginx only returns 502, automatically refresh the URL. How to write it in nginx? The following is the current nginx configuration file:

server {
    charset utf-8;
    listen 80;
    server_name www.yourdomain.com; 

    location /static { 
        alias /home/wangqidan/sites/www.yourdomain.com/yourdomain/static; 
    }

    location / { 
        proxy_set_header Host $host;
        proxy_pass http://unix:/tmp/www.yourdomain.com.socket;
    }
}
Apr.11,2021

customize the 502 page
then write JS refresh


this is impossible, let's see how to solve the 502 error


depends on the nginx error log, to see if it is a socket problem.

Menu