Skip to content

Instantly share code, notes, and snippets.

@hotta
Created August 8, 2017 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotta/b23e9ba71d3d36b7e73e943e1ab995e7 to your computer and use it in GitHub Desktop.
Save hotta/b23e9ba71d3d36b7e73e943e1ab995e7 to your computer and use it in GitHub Desktop.
always return http status 503 with custom error page using nginx.
<!-- /var/www/http503/custom_503.html -->
<html>
<body>
<h1>custom_503.html</h1>
<img src='images/job_it_dokata.png' alt='IT Dokata'>
</body>
</html>
# /etc/nginx/conf.d/http503.conf
server {
listen 80;
server_name http503.example.com;
error_page 404 =503 /custom_503.html;
error_page 403 =503 /custom_503.html;
root /var/www/http503;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment