Explorar o código

Merge branch 'master' of github.com:HttpErrorPages/HttpErrorPages

Andi Dittrich %!s(int64=6) %!d(string=hai) anos
pai
achega
f7a51a3730
Modificáronse 2 ficheiros con 91 adicións e 0 borrados
  1. 22 0
      README.md
  2. 69 0
      i18n/pages-zh_CN.json

+ 22 - 0
README.md

@@ -3,6 +3,7 @@
 [Lighttpd](#lighttpd-integration) | 
 [express.js](#expressjs-integration) | 
 [koa.js](#koajs-integration) | 
+[Caddy](#caddy-integration) |
 [Customization](#customization)
 
 # Simple HttpErrorPages #
@@ -228,6 +229,27 @@ Syntax: `Promise _httpErrorPages.koa([options:Object])`
 * `footer` - optional page footer content (html allowed). default **null**
 * `lang` - language definition which should be used (available in the `i18n/` directory). default **en_US**
 
+## Caddy Integration ##
+
+[Caddy](https://caddyserver.com/docs/errors) supports custom error-pages using `errors` directive. 
+
+File: Caddyfile
+
+Example - assumes HttpErrorPages are located into `/var/www/error`.
+
+```Caddyfile
+www.yoursite.com {
+    
+    // Other configurations
+
+    errors {
+        404 /var/www/error/HTTP404.html
+    }
+
+    // Other configurations
+
+}
+```
 
 ## Customization ##
 

+ 69 - 0
i18n/pages-zh_CN.json

@@ -0,0 +1,69 @@
+{        
+    // STANDARD ERROR CODES
+    // =======================================================
+
+    "400": {
+        "title": "无效的请求",
+        "message": "由于明显的客户端错误,服务器不能或不会处理该请求。" 
+    },
+    "401": {
+        "title": "未认证",
+        "message": "所请求的资源需要认证。"
+    },
+
+    "403": {
+        "title": "访问请求被拒绝",
+        "message": "所请求的资源需要认证" 
+    },
+    
+    // http 404 not found
+    "404": {
+        "title": "资源未找到",
+        "message": "找不到所请求的资源。" 
+    },
+    
+    // internal server error
+    "500": {
+        "title": "Webservice目前不可用",
+        "message": "发生了未知的问题。\n我们的技术支持团队正在努力修复中。" 
+    },
+    
+    // unknown http method
+    "501": {
+        "title": "方法未实现",
+        "message": "服务器不支持当前请求所需要的某个功能。"
+    },
+    
+    // http proxy forward error
+    "502": {
+        "title": "Webservice目前不可用",
+        "message": "我们的后端上游服务器出现了问题。\n技术支持团队正在努力修复中。"
+    },
+    
+    // webserver service error
+    "503": {
+        "title": "Webservice目前不可用",
+        "message": "我们的后端上游服务器出现了问题。\n技术支持团队正在努力修复中。"
+    },
+    
+    // CUSTOM ERROR CODES
+    // =======================================================
+
+    // webserver origin error
+    "520": {
+        "title": "未知的主机",
+        "message": "没有到达所请求的主机的路由。"
+    },
+    
+    // webserver down error
+    "521": {
+        "title": "Webservice暂时不可用",
+        "message": "我们的后端上游服务器出现了问题。\n技术支持团队正在努力修复中。"
+    },
+    
+    // maintenance
+    "533": {
+        "title": "日常维护",
+        "message": "本站暂时因维护原因而下线。\n我们将会尽快恢复。"                
+    }
+}