schubidos commented on issue #8747: URL: https://github.com/apache/apisix/issues/8747#issuecomment-1410705607
OK, that's interesting. I started with a new installation of apisix-docker/example: ``` git clone https://github.com/apache/apisix-docker.git cd apisix-docker/example docker-compose -p docker-apisix up -d ``` And then followed this tutorial step by step - https://apisix.apache.org/docs/apisix/tutorials/expose-api/ - so just copied the commands to my shell. I tried the same procedure on 2 notebooks with same result, one with windows 11 the other with windows 10 both with docker-desktop. Call `curl -i -X GET "http://127.0.0.1:9080/anything/get?foo1=bar1&foo2=bar2" -H "Host: example.com"` returns error 404 and the content of http://example.com Thats the corresponding access.log entry: ``` 172.18.0.1 - - [31/Jan/2023:08:03:09 +0000] example.com "GET /anything/get?foo1=bar1&foo2=bar2 HTTP/1.1" 404 1256 0.932 "-" "curl/7.68.0" 34.224.50.110:80 404 0.933 "http://example.com/anything/get?foo1=bar1&foo2=bar2" ``` And thats the log after setting `"pass_host": "node"`: ``` 172.18.0.1 - - [31/Jan/2023:08:12:01 +0000] example.com "GET /anything/get?foo1=bar1&foo2=bar2 HTTP/1.1" 200 462 0.470 "-" "curl/7.68.0" 34.205.150.168:80 200 0.430 "http://httpbin.org/anything/get?foo1=bar1&foo2=bar2" ``` I now tried your suggestion from my **local machine** (via wsl Ubuntu): `curl -i -X GET http://httpbin.org:80/anything/foo\?arg\=10 -H "Host: example.com"` this works fine: ``` HTTP/1.1 200 OK Date: Tue, 31 Jan 2023 16:21:01 GMT Content-Type: application/json Content-Length: 373 Connection: keep-alive Server: gunicorn/19.9.0 Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true { "args": { "arg": "10" }, "data": "", "files": {}, "form": {}, "headers": { "Accept": "*/*", "Host": "example.com", "User-Agent": "curl/7.68.0", "X-Amzn-Trace-Id": "Root=1-63d93fed-5f582fb17e0a8daa7cd307ef" }, "json": null, "method": "GET", "origin": "213.225.34.217", "url": "http://example.com/anything/foo?arg=10" } ``` Then I tried the same from the terminal in **docker container "docker-apisix-web1-1 nginx:1.19.0-alpine"** `curl -i -X GET "http://httpbin.org/anything/foo?arg=10" -H "Host: example.com"` And here the problem occurs: ``` HTTP/1.1 404 Not Found Accept-Ranges: bytes Age: 218528 Cache-Control: max-age=604800 Content-Type: text/html; charset=UTF-8 Date: Tue, 31 Jan 2023 16:27:43 GMT Expires: Tue, 07 Feb 2023 16:27:43 GMT Last-Modified: Sun, 29 Jan 2023 03:45:35 GMT Server: ECS (dcb/7FA3) Vary: Accept-Encoding X-Cache: 404-HIT Content-Length: 1256 <!doctype html> <html> <head> <title>Example Domain</title> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style type="text/css"> body { background-color: #f0f0f2; margin: 0; padding: 0; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; } div { width: 600px; margin: 5em auto; padding: 2em; background-color: #fdfdff; border-radius: 0.5em; box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02); } a:link, a:visited { color: #38488f; text-decoration: none; } @media (max-width: 700px) { div { margin: 0 auto; width: auto; } } </style> </head> <body> <div> <h1>Example Domain</h1> <p>This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.</p> <p><a href="https://www.iana.org/domains/example">More information...</a></p> </div> </body> </html> ``` -- 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]
