totemofwolf opened a new issue #5470: URL: https://github.com/apache/apisix/issues/5470
### Issue description **get http 400 status when using standalone mode with host contains underline** ### Environment - apisix version (cmd: `apisix version`): docker image apache/apisix:2.10.1 - OS (cmd: `uname -a`): k8s v1.20 with CentOS Linux 7 (Core) - 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`): - ### Steps to reproduce ``` yaml # set apisix.yaml routes: - uri: /* upstream_id: 1 - uri: /* host: amqp_cfan_node1.example.work scheme: http priority: 10 upstream_id: 2 name: "nexus" timeout: "connect": 5 "send": 300 "read": 300 - uri: /* host: amqp-cfan-node2.console.example.work scheme: http priority: 10 upstream_id: 2 name: "nexus" timeout: "connect": 5 "send": 300 "read": 300 upstreams: - id: 1 nodes: "127.0.0.1:9091": 10 type: roundrobin - id: 2 nodes: "192.168.222.127:15672": 10 type: roundrobin ``` ### Actual result ``` # get response: # curl -i http://amqp_cfan_node1.example.work -x 10.1.4.185:80 HTTP/1.1 400 Bad Request Server: openresty Date: Wed, 10 Nov 2021 05:35:41 GMT Content-Type: text/html; charset=utf-8 Content-Length: 154 Connection: close <html> <head><title>400 Bad Request</title></head> <body> <center><h1>400 Bad Request</h1></center> <hr><center>openresty</center> </body> </html> # curl -I amqp-cfan-node2.console.example.work -x 10.1.4.185:80 HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 Content-Length: 2884 Connection: keep-alive content-security-policy: script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self' date: Wed, 10 Nov 2021 03:58:54 GMT etag: "548885204" last-modified: Wed, 21 Jul 2021 08:56:39 GMT vary: origin Server: APISIX/2.10.1 ``` ### Error log ``` - - - [10/Nov/2021:11:58:54 +0800] amqp-cfan-node2.console.example.work "HEAD HTTP://amqp-cfan-node2.console.example.work/ HTTP/1.1" 200 0 0.003 "-" "curl/7.29.0" 192.168.222.127:15672 200 0.003 "http://amqp-cta-node2.console.example.work" - - - [10/Nov/2021:13:41:44 +0800] - "GET http://amqp_cfan_node1.example.work/ HTTP/1.1" 400 154 0.004 "-" "-" - - - "://" ``` ### Expected result 200 OK -- 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