zhoujiexiong commented on issue #11424: URL: https://github.com/apache/apisix/issues/11424#issuecomment-2259411782
> > @vortegatorres > > `upstream_status` is set at `apisix.http_balancer_phase`, but `serverless-pre-function @ rewrite phase returning 401(>=200, for more to see below) will interrupt that flow. > > If you want to modify the response from upstream, try serverless-xxx @ [header | body]_filter phase. > > ``` > > core.response.exit(401) -> ngx.exit(401) > > > > restydoc -s ngx.exit > > > > When "status >= 200" (i.e., "ngx.HTTP_OK" and above), it will interrupt > > the execution of the current request and return status code to Nginx. > > ... > > ``` > > If I understand correctly, the [header|body]_filter phases modify the upstream response. In my case, I use the `serverless-pre-function` plugin to be called from the `forward-auth` plugin, and there is no upstream body to modify, and your suggestion didn't work. Is there a workaround for setting the `upstream_status` in this scenario? Could you show the route/plugins config more similar with your scenario? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org