-
-
Save nop33/2b1fca58eac5fa2174b41fd577439b09 to your computer and use it in GitHub Desktop.
NGINX 502 autoreload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<title>502 Bad Gateway</title> | |
</head> | |
<body> | |
<body bgcolor="white"> | |
<center><h1>502 Bad Gateway</h1></center> | |
<hr><center>nginx</center> | |
<script> | |
function tryRefresh() { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', location.href); | |
xhr.send(null); | |
xhr.onreadystatechange = function() { | |
var DONE = 4; | |
if (xhr.readyState === DONE) { | |
if (xhr.status != 502) { | |
location.reload(true); | |
} else { | |
setTimeout(tryRefresh, 1000); | |
} | |
} | |
}; | |
} | |
tryRefresh(); | |
</script> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
# ... | |
server { | |
# ... | |
error_page 502 /502.html; | |
location = /502.html { | |
alias /home/omegak/.dotfiles/indico/502.html; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment