dongqisilent opened a new issue #5069:
URL: https://github.com/apache/apisix/issues/5069


   ### Issue description
   
   1、the route config like this
   ```{
       "methods": ["GET"],
       "uri": "/test/index.html",
       "plugins": {
           "proxy-rewrite": {
               "uri": "/test/home.html",
               "scheme": "http",
               "host": "iresty.com",
               "headers": {
                   "X-Api-Version": "v1",
                   "X-Api-Engine": "apisix",
                   "X-Api-useless": ""
               }
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "127.0.0.1:801": 1
           }
       }
   }```
   2. ```when curl : curl -X GET http://127.0.0.1:9080/test/index.html
   <html>
   <head><title>502 Bad Gateway</title></head>
   <body>
   <center><h1>502 Bad Gateway</h1></center>
   <hr><center>openresty</center>
   </body>
   </html>```
   3. apisis error.log show
   2021/09/16 00:55:57 [error] 22442#22442: *254872558 connect() failed (111: 
Connection refused) while connecting to upstream, client: 127.0.0.1, server: _, 
request: "GET /test/index.html HTTP/1.1", upstream: 
"http://127.0.0.1:801/test/home.html";, host: "127.0.0.1:9080"
   
   4. apisix access.log is
   127.0.0.1 - - [16/Sep/2021:00:55:57 +0800] 127.0.0.1:9080 "GET 
/test/index.html HTTP/1.1" 502 154 0.004 "-" "curl/7.29.0" 127.0.0.1:801 502 
0.004 "http://iresty.com/test/home.html";
   
   5. the problem is the host has been changed to iresty.com,why apisix 
connecting to  127.0.0.1
   
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - 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`):
   


-- 
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]


Reply via email to