提交 f9715be3 authored 作者: zhanrongzhen's avatar zhanrongzhen

fix nginx.conf bug

上级 d755c26f
......@@ -88,13 +88,13 @@ http {
return ngx.exit(ngx.HTTP_NOT_FOUND)
end
local etag = string.format("%x-%x", attributes.mtime, attributes.size)
etag = '"' .. etag .. '"'
local if_none_match = ngx.req.get_headers()["If-None-Match"]
if if_none_match == etag then
ngx.status = 304
return
end
-- local etag = attributes.mtime
-- etag = '"' .. etag .. '"'
-- local if_none_match = ngx.req.get_headers()["If-None-Match"]
-- if if_none_match == etag then
-- ngx.status = 304
-- return
-- end
-- 2. 判断是否有扩展名
local ext = string.match(filename, "%.([^%.]+)$")
......@@ -114,7 +114,7 @@ http {
ngx.header["Content-Type"] = mime_type
ngx.header["Content-Length"] = attributes.size
ngx.header["Cache-Control"] = "max-age=86400"
ngx.header["ETag"] = etag
-- ngx.header["ETag"] = etag
-- ngx.header["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0"
-- ngx.header["Pragma"] = "no-cache"
-- ngx.header["Expires"] = "0"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论