Nginx config
server {
listen *:80;
server_name live.domain.com;
server_tokens off;
charset utf-8;
error_log /var/log/nginx/live-error.log info;
access_log /var/log/nginx/live-access.log;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:1337;
proxy_redirect off;
}
}
When node.js is working everything is okay, but if node.js not started and I try to load page http://live.domain.com/socket.io/socket.io.js it makes me wait 30 seconds (read_timeout).
I want make it so, that if node.js not running I'm getting 404 or 502 error right away without 30 seconds waiting for timeout.
In other words: I need to check node.js on client side right away.