You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/10/26 02:08:48 UTC

[GitHub] [apisix] Caibreeze0908 opened a new issue, #8176: How does the set in nginx work in apisix?

Caibreeze0908 opened a new issue, #8176:
URL: https://github.com/apache/apisix/issues/8176

   ### Description
   
   In nginx configuration:
   location / {
           set $args $args&test=123;
           proxy_pass http://test;
   }
   How should apisix be configured?
   
   ### Environment
   
   - APISIX version (run `apisix version`):2.13
   - Operating system (run `uname -a`): 3.10.0-514.el7.x86_64
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): openresty/1.19.3.1
   - 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`):
   


-- 
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-unsubscribe@apisix.apache.org.apache.org

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


[GitHub] [apisix] Hazel6869 commented on issue #8176: How does the set in nginx work in apisix?

Posted by GitBox <gi...@apache.org>.
Hazel6869 commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1296444426

   @Caibreeze0908 do you have any questions?
   


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] github-actions[bot] commented on issue #8176: How does the set in nginx work in apisix?

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1732535549

   Due to lack of the reporter's response this issue has been labeled with "no response". It will be close in 3 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] Caibreeze0908 commented on issue #8176: How does the set in nginx work in apisix?

Posted by GitBox <gi...@apache.org>.
Caibreeze0908 commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1294377211

   > `➜ apisix-docker 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", "plugins": { "proxy-rewrite": { "uri": "/get?$args&test2=123", "scheme": "http", "host": "iresty.com", "headers": { "X-Api-Version": "v1", "X-Api-Engine": "apisix", "X-Api-useless": "" } } }, "upstream": { "type": "roundrobin", "nodes": { "httpbin.org": 1 } } }'
   > 
   > curl -X GET 'http://127.0.0.1:9080/test/index.html?test=123' -v {"node":{"key":"/apisix/routes/1","value":{"plugins":{"proxy-rewrite":{"host":"iresty.com","scheme":"http","uri":"/get?$args&test2=123","use_real_request_uri_unsafe":false,"headers":{"X-Api-useless":"","X-Api-Version":"v1","X-Api-Engine":"apisix"}}},"methods":["GET"],"uri":"/test/index.html","priority":0,"create_time":1665568096,"update_time":1666778466,"status":1,"upstream":{"scheme":"http","hash_on":"vars","pass_host":"pass","nodes":{"httpbin.org":1},"type":"roundrobin"},"id":"1"}},"action":"set"} 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 127.0.0.1 (127.0.0.1) port 7890 (#0)
   > 
   > > GET http://127.0.0.1:9080/test/index.html?test=123 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: 490
   >   < Access-Control-Allow-Credentials: true
   >   < Access-Control-Allow-Origin: *
   >   < Connection: keep-alive
   >   < Content-Type: application/json
   >   < Date: Wed, 26 Oct 2022 10:01:07 GMT
   >   < Keep-Alive: timeout=4
   >   < Proxy-Connection: keep-alive
   >   < Server: APISIX/2.15.0
   >   <
   >   {
   >   "args": {
   >   "test": [
   >   "123",
   >   "123"
   >   ],
   >   "test2": "123"
   >   },
   >   "headers": {
   >   "Accept": "_/_",
   >   "Accept-Encoding": "gzip",
   >   "Host": "iresty.com",
   >   "User-Agent": "curl/7.81.0",
   >   "X-Amzn-Trace-Id": "Root=1-63590563-4305939f23c1560c43ae3f66",
   >   "X-Api-Engine": "apisix",
   >   "X-Api-Version": "v1",
   >   "X-Forwarded-Host": "127.0.0.1"
   >   },
   >   "origin": "172.20.0.1, 61.241.66.251",
   >   "url": "http://127.0.0.1/get?test=123&test2=123&test=123"
   >   }
   > * Connection #0 to host 127.0.0.1 left intact
   >   ➜  apisix-docker git:(master) ✗`
   使用了路径改写:
   匹配正则表达式:/(.*)
   转发路径模板:/$1?$args&test=123


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] shreemaan-abhishek commented on issue #8176: How does the set in nginx work in apisix?

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1708115077

   @Caibreeze0908, do you have any further questions/updates? If not, please close the issue. Thanks.


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] github-actions[bot] closed issue #8176: How does the set in nginx work in apisix?

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8176: How does the set in nginx work in apisix?
URL: https://github.com/apache/apisix/issues/8176


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] Caibreeze0908 commented on issue #8176: How does the set in nginx work in apisix?

Posted by GitBox <gi...@apache.org>.
Caibreeze0908 commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1294376429

   > `➜ apisix-docker 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", "plugins": { "proxy-rewrite": { "uri": "/get?$args&test2=123", "scheme": "http", "host": "iresty.com", "headers": { "X-Api-Version": "v1", "X-Api-Engine": "apisix", "X-Api-useless": "" } } }, "upstream": { "type": "roundrobin", "nodes": { "httpbin.org": 1 } } }'
   > 
   > curl -X GET 'http://127.0.0.1:9080/test/index.html?test=123' -v {"node":{"key":"/apisix/routes/1","value":{"plugins":{"proxy-rewrite":{"host":"iresty.com","scheme":"http","uri":"/get?$args&test2=123","use_real_request_uri_unsafe":false,"headers":{"X-Api-useless":"","X-Api-Version":"v1","X-Api-Engine":"apisix"}}},"methods":["GET"],"uri":"/test/index.html","priority":0,"create_time":1665568096,"update_time":1666778466,"status":1,"upstream":{"scheme":"http","hash_on":"vars","pass_host":"pass","nodes":{"httpbin.org":1},"type":"roundrobin"},"id":"1"}},"action":"set"} 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 127.0.0.1 (127.0.0.1) port 7890 (#0)
   > 
   > > GET http://127.0.0.1:9080/test/index.html?test=123 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: 490
   >   < Access-Control-Allow-Credentials: true
   >   < Access-Control-Allow-Origin: *
   >   < Connection: keep-alive
   >   < Content-Type: application/json
   >   < Date: Wed, 26 Oct 2022 10:01:07 GMT
   >   < Keep-Alive: timeout=4
   >   < Proxy-Connection: keep-alive
   >   < Server: APISIX/2.15.0
   >   <
   >   {
   >   "args": {
   >   "test": [
   >   "123",
   >   "123"
   >   ],
   >   "test2": "123"
   >   },
   >   "headers": {
   >   "Accept": "_/_",
   >   "Accept-Encoding": "gzip",
   >   "Host": "iresty.com",
   >   "User-Agent": "curl/7.81.0",
   >   "X-Amzn-Trace-Id": "Root=1-63590563-4305939f23c1560c43ae3f66",
   >   "X-Api-Engine": "apisix",
   >   "X-Api-Version": "v1",
   >   "X-Forwarded-Host": "127.0.0.1"
   >   },
   >   "origin": "172.20.0.1, 61.241.66.251",
   >   "url": "http://127.0.0.1/get?test=123&test2=123&test=123"
   >   }
   > * Connection #0 to host 127.0.0.1 left intact
   >   ➜  apisix-docker git:(master) ✗`
   
   [error] 14641#14641: attempt to use named capturing variable "args" (named captures not supported yet)


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] Hazel6869 commented on issue #8176: How does the set in nginx work in apisix?

Posted by GitBox <gi...@apache.org>.
Hazel6869 commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1291795634

   `➜  apisix-docker 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",
       "plugins": {
           "proxy-rewrite": {
               "uri": "/get?$args&test2=123",
               "scheme": "http",
               "host": "iresty.com",
               "headers": {
                   "X-Api-Version": "v1",
                   "X-Api-Engine": "apisix",
                   "X-Api-useless": ""
               }
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "httpbin.org": 1
           }
       }
   }'
   
   
   curl -X GET 'http://127.0.0.1:9080/test/index.html?test=123' -v
   {"node":{"key":"\/apisix\/routes\/1","value":{"plugins":{"proxy-rewrite":{"host":"iresty.com","scheme":"http","uri":"\/get?$args&test2=123","use_real_request_uri_unsafe":false,"headers":{"X-Api-useless":"","X-Api-Version":"v1","X-Api-Engine":"apisix"}}},"methods":["GET"],"uri":"\/test\/index.html","priority":0,"create_time":1665568096,"update_time":1666778466,"status":1,"upstream":{"scheme":"http","hash_on":"vars","pass_host":"pass","nodes":{"httpbin.org":1},"type":"roundrobin"},"id":"1"}},"action":"set"}
   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 127.0.0.1 (127.0.0.1) port 7890 (#0)
   > GET http://127.0.0.1:9080/test/index.html?test=123 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: 490
   < Access-Control-Allow-Credentials: true
   < Access-Control-Allow-Origin: *
   < Connection: keep-alive
   < Content-Type: application/json
   < Date: Wed, 26 Oct 2022 10:01:07 GMT
   < Keep-Alive: timeout=4
   < Proxy-Connection: keep-alive
   < Server: APISIX/2.15.0
   <
   {
     "args": {
       "test": [
         "123",
         "123"
       ],
       "test2": "123"
     },
     "headers": {
       "Accept": "*/*",
       "Accept-Encoding": "gzip",
       "Host": "iresty.com",
       "User-Agent": "curl/7.81.0",
       "X-Amzn-Trace-Id": "Root=1-63590563-4305939f23c1560c43ae3f66",
       "X-Api-Engine": "apisix",
       "X-Api-Version": "v1",
       "X-Forwarded-Host": "127.0.0.1"
     },
     "origin": "172.20.0.1, 61.241.66.251",
     "url": "http://127.0.0.1/get?test=123&test2=123&test=123"
   }
   * Connection #0 to host 127.0.0.1 left intact
   ➜  apisix-docker 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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] Hazel6869 commented on issue #8176: How does the set in nginx work in apisix?

Posted by GitBox <gi...@apache.org>.
Hazel6869 commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1291591384

   @Caibreeze0908 Hi, can you give me more information,  i can not understand you. 


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] Caibreeze0908 commented on issue #8176: How does the set in nginx work in apisix?

Posted by GitBox <gi...@apache.org>.
Caibreeze0908 commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1291831063

   ok,thank you,I try it.


-- 
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-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] github-actions[bot] commented on issue #8176: How does the set in nginx work in apisix?

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8176:
URL: https://github.com/apache/apisix/issues/8176#issuecomment-1737091747

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
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-unsubscribe@apisix.apache.org

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