Skip to content

bug: nginx proxy_redirect no default setting #12222

@xiangtianyu

Description

@xiangtianyu

Current Behavior

I create a new route

{
  "uri": "/*",
  "name": "/",
  "priority": -1,
  "methods": [
    "GET",
    "POST",
    "PUT",
    "DELETE",
    "PATCH",
    "HEAD",
    "OPTIONS",
    "TRACE"
  ],
  "host": "xxx.test.com",
  "upstream_id": "00000000000000000001",
  "status": 1
} 

with upstream

{
  "nodes": [
    {
      "host": "test.inner.com",
      "port": 80,
      "weight": 1
    }
  ],
  "timeout": {
    "connect": 60,
    "send": 60,
    "read": 60
  },
  "type": "roundrobin",
  "hash_on": "vars",
  "scheme": "http",
  "pass_host": "node",
  "name": "test.inner.com",
  "keepalive_pool": {
    "idle_timeout": 320,
    "requests": 60,
    "size": 1000
  }
}

The xxx.test.com is normal domain and the test.inner.com is our Intranet domain, when we request the url it will redirect 301 by our app and the returned location host is test.inner.com, that caused failed. The old nginx gateway has a default set of proxy_redirect default, so the location host is xxx.test.com, but apisix not.

Expected Behavior

response header location host should be xxx.test.com

Error Logs

No response

Steps to Reproduce

create route and upsteam and will reproduce

Environment

  • APISIX version (run apisix version): 3.9
  • Operating system (run uname -a): centos
  • 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

    questionlabel for questions asked by users

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions