Hazel6869 commented on issue #8199: URL: https://github.com/apache/apisix/issues/8199#issuecomment-1296438481
@jeffreys-cat I give you an example more detailed `➜ example git:(master) ✗ curl http://127.0.0.1:9080/apisix/admin/routes/1 \ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "methods": ["GET"], "uri": "/test/index.html", "vars": [ [ "arg_http_accept_language", "==", "en" ] ], "plugins": { "proxy-rewrite": { "uri": "/get?$args", "scheme": "http", "host": "iresty.com", "headers": { "Location": "https://cn.goose.com" } } }, "upstream": { "type": "roundrobin", "nodes": { "httpbin.org": 1 } } }' {"action":"set","node":{"key":"\/apisix\/routes\/1","value":{"methods":["GET"],"plugins":{"proxy-rewrite":{"uri":"\/get?$args","scheme":"http","headers":{"Location":"https:\/\/cn.goose.com"},"use_real_request_uri_unsafe":false,"host":"iresty.com"}},"id":"1","upstream":{"scheme":"http","hash_on":"vars","nodes":{"httpbin.org":1},"type":"roundrobin","pass_host":"pass"},"uri":"\/test\/index.html","priority":0,"status":1,"update_time":1667181078,"vars":[["arg_http_accept_language","==","en"]],"create_time":1665568096}}} ➜ example git:(master) ✗ curl -X GET 'http://127.0.0.1:9080/test/index.html?http_accept_language=en' -v Note: Unnecessary use of -X or --request, GET is already inferred. * Uses proxy env variable http_proxy == 'http://127.0.0.1:7890' * Trying 127.0.0.1:7890... * Connected to (nil) (127.0.0.1) port 7890 (#0) > GET http://127.0.0.1:9080/test/index.html?http_accept_language=en HTTP/1.1 > Host: 127.0.0.1:9080 > User-Agent: curl/7.81.0 > Accept: */* > Proxy-Connection: Keep-Alive > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Content-Length: 485 < Access-Control-Allow-Credentials: true < Access-Control-Allow-Origin: * < Connection: keep-alive < Content-Type: application/json < Date: Mon, 31 Oct 2022 01:51:38 GMT < Keep-Alive: timeout=4 < Proxy-Connection: keep-alive < Server: APISIX/2.15.0 < { "args": { "http_accept_language": [ "en", "en" ] }, "headers": { "Accept": "*/*", "Accept-Encoding": "gzip", "Host": "iresty.com", "Location": "https://cn.goose.com", "User-Agent": "curl/7.81.0", "X-Amzn-Trace-Id": "Root=1-635f2a2a-272df4c93b26d19c2d973b4f", "X-Forwarded-Host": "127.0.0.1" }, "origin": "172.19.0.1, 61.241.66.251", "url": "http://127.0.0.1/get?http_accept_language=en&http_accept_language=en" } * Connection #0 to host (nil) left intact ➜ example git:(master) ✗` -- 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]
