Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why can't I use ngx.redirect or ngx.say in the header_filter_by_lua phase #2271

Closed
zhyfei opened this issue Dec 20, 2023 · 1 comment
Closed

Comments

@zhyfei
Copy link

zhyfei commented Dec 20, 2023

Why can't I use ngx.redirect or ngx.say in the header_filter_by_lua phase? I have a requirement to intercept download requests, and I have to use the following method.
ngx.header["Content-Type"] = "text/html;charset=utf-8"
ngx.header["Location"] = sso_portal_401
ngx.status = 307
ngx.exit(ngx.status)
Is this approach risky?

@zhuizhuhaomeng
Copy link
Contributor

This approach looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants