yasser-mas2 edited a comment on issue #5654:
URL: https://github.com/apache/apisix/issues/5654#issuecomment-985213904


   > Here are the steps I took to reproduce it on master branch
   > 
   > 1. backend is an openresty server, nginx.conf is like
   > 
   > ```nginx
   > master_process on;
   > 
   > worker_processes 2;
   > 
   > error_log logs/error.log warn;
   > pid logs/nginx.pid;
   > 
   > worker_rlimit_nofile 20480;
   > 
   > events {
   >     accept_mutex off;
   >     worker_connections 10620;
   > }
   > 
   > worker_shutdown_timeout 3;
   > 
   > http {
   >     server {
   >         listen 1980;
   > 
   >         access_log off;
   >         location / {
   >             content_by_lua_block {
   >                 ngx.say("uri: ", ngx.var.uri)
   >             }
   >         }
   >     }
   > }
   > ```
   > 
   > 2. route config of APISIX
   > 
   > ```shell
   > curl --location --request PUT 
'http://127.0.0.1:9080/apisix/admin/routes/1' \
   > --header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
   > --header 'Content-Type: application/json' \
   > --data-raw '{
   >     "plugins": {
   >         "proxy-rewrite": {
   >             "regex_uri": ["^/api/(.*)","/$1"]
   >         }
   >     },
   >     "upstream": {
   >         "nodes": {
   >             "127.0.0.1:1980": 1
   >         },
   >         "type": "roundrobin"
   >     },
   >     "uri": "/api/groups/*"
   > }'
   > ```
   > 
   > 3. test
   > 
   > ```shell
   > $curl http://127.0.0.1:9080/api/groups/%3CNumber%3E
   > uri: /groups/<Number>
   > ```
   > 
   > Is this what you want?
   
   No this is not, we already managed to strip the route prefix by using the 
regex.
   
   The issue is the gateway server decoding the route and not encoding it 
again, what I want is when submitting this request 
   `$curl http://127.0.0.1:9080/api/groups/%3CNumber%3E`
   
   I need to get this 
   
   `uri: /groups/%3CNumber%3E`
   
   NOT that:
   `uri: /groups/<Number>`
   


-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to