local exit = require "sm.utils.exit"

local _M = {}

function _M.rewrite()
    if ngx.var.site == "" then
        return exit.rule_block(ngx.var.remote_addr, ngx.var.request_id)
    end
    ngx.log(ngx.INFO, "rewrite to proxy,uri: " .. ngx.var.uri)
    ngx.req.set_uri(string.sub(ngx.var.uri, 8), false) -- string.len("/@proxy") + 1 -- 子请求不会改变var
end

return _M