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

fix nginx.conf bug

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