Skip to content

Instantly share code, notes, and snippets.

@clarketm
Forked from weapp/nginx.conf
Created January 27, 2019 00:04
Show Gist options
  • Save clarketm/8d4fc9b2bfacc4030c47e056ecf09e01 to your computer and use it in GitHub Desktop.
Save clarketm/8d4fc9b2bfacc4030c47e056ecf09e01 to your computer and use it in GitHub Desktop.

Revisions

  1. @weapp weapp created this gist Aug 4, 2014.
    51 changes: 51 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@

    error_page 500 /500.html;
    location /500.html{
    return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
    }

    error_page 502 /502.html;
    location /502.html{
    return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
    }

    error_page 503 /503.html;
    location /503.html{
    return 503 '{"error": {"status_code": 503,"status": "Service Temporarily Unavailable"}}';
    }

    error_page 504 /504.html;
    location /504.html{
    return 504 '{"error": {"status_code": 504,"status": "Gateway Timeout"}}';
    }

    error_page 400 /400.html;
    location /400.html{
    return 400 '{"error": {"status_code": 400,"status": "Bad Request"}}';
    }

    error_page 401 /401.html;
    location /401.html{
    return 401 '{"error": {"status_code": 401,"status": "Unauthorized"}}';
    }

    error_page 403 /403.html;
    location /403.html{
    return 403 '{"error": {"status_code": 403,"status": "Forbidden"}}';
    }

    error_page 404 /404.html;
    location /404.html{
    return 404 '{"error": {"status_code": 404,"status": "Not Found"}}';
    }

    error_page 408 /408.html;
    location /408.html{
    return 408 '{"error": {"status_code": 408,"status": "Request Timeout}}';
    }

    error_page 418 /418.html;
    location /418.html{
    return 418 '{"error": {"status_code": 418,"status": "I\'m a teapot"}}';
    }