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 2020/11/04 06:40:13 UTC
[GitHub] [apisix] BlinglingGirl opened a new issue #2621: request help: how to create new routing rule by vars 【"server_port"】
BlinglingGirl opened a new issue #2621:
URL: https://github.com/apache/apisix/issues/2621
### Issue description
curl http://192.168.1.149:9080/apisix/admin/routes/5 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"methods": ["GET"],
"uri": "/",
"vars": [["server_port", "==", "9081"]],
"upstream": {
"type": "roundrobin",
"nodes": {
"192.168.1.149:8182": 1
}
}
}'
response 400 Bad Request
### Environment
* apisix version : 2.0
* OS: centos 7
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander closed issue #2621: request help: how to create new routing rule matching designated port by vars 【"server_port"】
Posted by GitBox <gi...@apache.org>.
spacewander closed issue #2621:
URL: https://github.com/apache/apisix/issues/2621
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] BlinglingGirl commented on issue #2621: request help: how to create new routing rule matching designated port by vars 【"server_port"】
Posted by GitBox <gi...@apache.org>.
BlinglingGirl commented on issue #2621:
URL: https://github.com/apache/apisix/issues/2621#issuecomment-721546628
this is my error , this body don't match json style.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2621: request help: how to create new routing rule matching designated port by vars 【"server_port"】
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2621:
URL: https://github.com/apache/apisix/issues/2621#issuecomment-721546100
Can't reproduce in my side.
Could you provide the error log?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander edited a comment on issue #2621: request help: how to create new routing rule matching designated port by vars 【"server_port"】
Posted by GitBox <gi...@apache.org>.
spacewander edited a comment on issue #2621:
URL: https://github.com/apache/apisix/issues/2621#issuecomment-721546100
Can't reproduce in my side.
I got:
```shell
¥ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"methods": ["GET"],
"uri": "/",
"vars": [["server_port", "==", "9081"]],
"upstream": {
"type": "roundrobin",
"nodes": {
"192.168.1.149:8182": 1
}
}
}'
HTTP/1.1 201 Created
Server: openresty
Date: Wed, 04 Nov 2020 06:48:47 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: *
Access-Control-Max-Age: 3600
{"action":"set","node":{"value":{"id":"5","vars":[["server_port","==","9081"]],"methods":["GET"],"uri":"\/","upstream":{"hash_on":"vars","type":"roundrobin","pass_host":"pass","nodes":{"192.168.1.149:8182":1}},"priority":0},"key":"\/apisix\/routes\/5"},"header":{"revision":"5203","member_id":"10276657743932975437","raft_term":"64","cluster_id":"14841639068965178418"}}
```
Could you provide the error log?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2621: request help: how to create new routing rule matching designated port by vars 【"server_port"】
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2621:
URL: https://github.com/apache/apisix/issues/2621#issuecomment-721547039
OK, I will close this issue.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org