-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
bug: redirect http to https but port not change #7011
Comments
Yep, it's a big problem :-( |
as: https://github.com/apache/apisix/pull/6686/files#r868034475 Can we set a default value for this case? |
@tzssangglass What if the client doesn't carry |
In this case the user needs to make the request headers carry When enabling Just an idea. |
That's not so generic. APISIX should have a generic solution. Such as using the HTTPS port (we can know it from |
I agree with this way |
It means place one initial variable in |
Yes. But we can have a custom logic that just get the HTTPS port from the
|
If the https redirect port from config.yaml, seems update it has to restart apisix manually? like changing 443 to 8443. Why not from plugin's attribute? It can be updated automatically. |
After discussion, we adopted the following solution When enabling
|
Current Behavior
Recently, I upgraded apisix with the latest code, and found that there was an error in converting http to https. When redirecting, I always bring a port 80. It should be caused by this change:https://github.com/apache/apisix/pull/6686/files#r867816800
Maybe
set $var_x_forwarded_port $server_port;
in ngx_tpl.lua conflicts withlocal ret_port = tonumber(ctx.var["var_x_forwarded_port"])
in redirect.luaExpected Behavior
port changed from 80 to 443
Error Logs
No response
Steps to Reproduce
add redirect and set http_to_https to true
Environment
apisix version
): masteruname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: