openresty修改302的location

header_filter_by_lua

location  /demo {
                proxy_pass http://localhost:3000/demo ;
                header_filter_by_lua '
                    local url = ngx.header.Location
                    if not url then
                        return
                    else
                        ngx.header.Location = "http://localhost:3001/newDemo"
                    end
                ';
        }
    原文作者:codecraft
    原文地址: https://segmentfault.com/a/1190000007760402
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞