From 3f13a5c133b305b0630f1a1c5f9c562db3d0ff61 Mon Sep 17 00:00:00 2001 From: ysyx2008 Date: Tue, 10 Nov 2015 14:44:45 +0800 Subject: [PATCH] Update init.lua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 设置输出字符集选项为UTF-8,使HTML页面在GBK字符集环境下也能够正确显示,避免乱码 --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index eb44bf0..b0d4ede 100644 --- a/init.lua +++ b/init.lua @@ -70,7 +70,7 @@ ckrules=read_rule('cookie') function say_html() if Redirect then - ngx.header.content_type = "text/html" + ngx.header.content_type = "text/html; charset=UTF-8" ngx.status = ngx.HTTP_FORBIDDEN ngx.say(html) ngx.exit(ngx.status)