您好亦春:location ^~ /iform_web { access_by_lua_file /server/nginx/conf/lua_script/limit.lua;limit.lua:中加了这行代码就触发浏览器下载,删除这行就正常: resp_ct = ngx.resp.get_headers()['content-type’]下载时的响应:(发现多了一行:红色部分)HTTP/1.1 200 OKServer: nginx/1.12.1Date: Tue, 06 Feb 2018 01:28:17 GMTContent-Type: application/octet-streamTransfer-Encoding: chunkedConnection: keep-alive正常时的响应:HTTP/1.1 200 OKServer: nginx/1.12.1Date: Tue, 06 Feb 2018 01:26:16 GMTTransfer-Encoding: chunkedConnection: keep-alive百思不得其解,望指教哈,十分感谢!
您好亦春:location ^~ /iform_web { access_by_lua_file /server/nginx/conf/lua_script/limit.lua;limit.lua:中加了这行代码就触发浏览器下载,删除这行就正常: resp_ct = ngx.resp.get_headers()['content-type’]下载时的响应:(发现多了一行:红色部分)HTTP/1.1 200 OKServer: nginx/1.12.1Date: Tue, 06 Feb 2018 01:28:17 GMTContent-Type: application/octet-streamTransfer-Encoding: chunkedConnection: keep-alive正常时的响应:HTTP/1.1 200 OKServer: nginx/1.12.1Date: Tue, 06 Feb 2018 01:26:16 GMTTransfer-Encoding: chunkedConnection: keep-alive百思不得其解,望指教哈,十分感谢!您的回复:Hello!请加入 openresty 中文邮件列表并在那里交流和讨论这样的问题,而不要直接发邮件给我。谢谢合作!详情请见https://openresty.org/en/community.html另外,你遇到的问题应该已经在最新版的 OpenResty 中修复了,请尝试使用最新版:https://openresty.org/en/download.htmlRegards,Yichun我git pull了https://github.com/openresty/lua-nginx-module 的最新代码,重新编译了nginx,问题依然存在的
Hi!参考下这个 issue:https://github.com/openresty/openresty/issues/92
lua_use_default_type off;
Hi!现在 ngx_lua 里就是会在上层第一次取响应头时去设 Content-Type。如果不想触发的话,可以设置指令:lua_use_default_type off;
您好:我试了一下,加了这个指令,resp_ct = ngx.resp.get_headers()['content-type']就获取不到值了,正常的也获取不到了,比如css文件的:Content-Type:text/css在 2018年2月7日星期三 UTC+8上午10:19:24,tokers写道:Hi!现在 ngx_lua 里就是会在上层第一次取响应头时去设 Content-Type。如果不想触发的话,可以设置指令:lua_use_default_type off; --