tzssangglass opened a new issue #6405:
URL: https://github.com/apache/apisix/issues/6405


   ### Issue description
   
   origin mail: https://lists.apache.org/thread/c3o6v9y8o4rotbnr1g2rvkzrbwzv9dnf
   
   User Description: 
   ```
   And when I use the same config :
   
   \"proxy-rewrite\": {
         \"headers\": {
           \"X-USER-ID\": \"USER1-ID\"
         }
       }
   
   In the route config it works :
   
   curl --location --request PUT
   "http://$APISIX_URL:$APISIX_PORT/apisix/admin/routes/api-v1"; \
   --header "X-API-KEY: $APISIX_API_ADMIN_KEY" \
   --header "Content-Type: application/json" \
   --data-raw "{
     \"uri\": \"/v1/*\",
     \"host\": \"$APISIX_HOST\",
     \"plugins\": {
       \"key-auth\": {},
       \"consumer-restriction\": {
           \"whitelist\": [
               \"user1\",
               \"user2\"
           ]
       },
       \"proxy-rewrite\": {
         \"headers\": {
           \"X-USER-ID\": \"USER1-ID\"
         }
       }
     },
     \"service_id\": \"api-v1\"
   }"
   ```
   
   and
   
   ```
   I mean that when I configure the plugin proxy-rewrite on the routes I have
   the header X-USER-ID set with the value USER1-ID (everything is fine) and
   when I configure it on the consumer user1 and I call the endpoint with the
   apikey of user1, the header X-USER-ID does not exist.
   ```
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks 
--version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to