Skip to content

bug: redirect http to https but port not change #7011

Description

@tangzhenhuang

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 with local ret_port = tonumber(ctx.var["var_x_forwarded_port"]) in redirect.lua

Expected 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 (run apisix version): master
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions