Skip to content

The proxy-rewrite plugin does not support pass nginx's variable within header #3117

Description

@yongboy

Issue description

I want to pass the nginx's Embedded Variables for upstream applications, below is my proxy-rewrite plugin's config:

{
    "headers": {
        "X-AUTH-UID": "$arg_uid"
    },
    "regex_uri": [
        "^/monitor/(.*)",
        "/$1"
    ]
}

The test url:

curl http://gw.dev/monitor/hello?uid=10001

The upstream application got the raw req info below:

GET /hello?uid=10001 HTTP/1.1
Host: gw.dev
X-Real-IP: 172.19.0.1
X-Forwarded-For: 172.19.0.1
X-Forwarded-Proto: http
X-Forwarded-Host: gw.dev
X-Forwarded-Port: 9080
User-Agent: curl/7.64.1
Accept: */*
X-AUTH-UID: $arg_uid

......

Environment

  • apisix version : 1.5
  • OS: MacOS
  • OpenRestyx / Nginx version: nginx/1.17.3

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions