最近有一个微信端要上,需要凌晨12点上线,不可能让我等到12点切流量吧,于是早早的配置好,回家睡觉
很简单,主要在nginx这层做点处理,就行了,废话不多说,直接代码
location / {
access_by_lua_block {
if ngx.time() >= 1480521600 then
local user_agent = ngx.var.http_user_agent
if user_agent ~= nil then
local m, ret = ngx.re.match(user_agent, "Android|webOS|iPhone|iPod|BlackBerry")
if m ~= nil then ngx.redirect("/app/index.html")