sunheyi6 commented on PR #11024:
URL: https://github.com/apache/apisix/pull/11024#issuecomment-1999397640

   > * If you actually run the example, you won't get the expected response. It 
doesn't address the issue you opened earlier.
   
   @kayx23 I have switched to a new Windows computer and the tests are giving 
the expected results in wsl2.
   The order is as follows: test  add test delete add test
   ```shell
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9080"; --head | grep Server
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  
Current
                                    Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   Server: APISIX/3.8.0
   root@DESKTOP-F0LS87N:~# curl -X GET 
http://localhost:9180/apisix/admin/upstreams
   {"total":0,"list":[]}
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9080/headers";
   {"error_msg":"404 Route Not Found"}
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9180/apisix/admin/routes"; -X 
PUT \
   X-API-KEY: ${ADM>   -H "X-API-KEY: ${ADMIN_API_KEY}" \
   >   -d '{
    "proxy-rewrite->     "id": "proxy-rewrite-route",
   >     "methods": ["GET"],
   >     "uri": "/headers",
   >     "plugins": {
   >       "proxy-rewrite": {
   >         "host": "myapisix.demo"
   >       }
   >     },
   >     "upstream": {
   >       "type": "roundrobin",
   >       "nodes": {
   >         "httpbin.org:80": 1
   >       }
   >     }
   >   }';
   
{"key":"/apisix/routes/proxy-rewrite-route","value":{"status":1,"create_time":1710499147,"upstream":{"pass_host":"pass","nodes":{"httpbin.org:80":1},"hash_on":"vars","type":"roundrobin","scheme":"http"},"id":"proxy-rewrite-route","priority":0,"plugins":{"proxy-rewrite":{"use_real_request_uri_unsafe":false,"host":"myapisix.demo"}},"update_time":1710499147,"uri":"/headers","methods":["GET"]}}
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9080/headers";
   {
     "headers": {
       "Accept": "*/*",
       "Host": "myapisix.demo",
       "User-Agent": "curl/7.68.0",
       "X-Amzn-Trace-Id": "Root=1-65f42550-22507dd94115831074d1f25d",
       "X-Forwarded-Host": "127.0.0.1"
     }
   }
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9180/apisix/admin/routes"; -X 
PUT \
   X-API-KEY: ${ADM>   -H "X-API-KEY: ${ADMIN_API_KEY}" \
   >   -d '{
   >     "id": "proxy-rewrite-route",
   >     "methods": ["GET"],
   >     "uri": "/headers",
   >     "plugins": {},
   >     "upstream": {
   >       "type": "roundrobin",
   >       "nodes": {
    "127.0.0.1:80":>         "127.0.0.1:80": 1
   >       }
   >     }
   >   }';
   
{"key":"/apisix/routes/proxy-rewrite-route","value":{"status":1,"create_time":1710499147,"upstream":{"pass_host":"pass","nodes":{"127.0.0.1:80":1},"hash_on":"vars","type":"roundrobin","scheme":"http"},"id":"proxy-rewrite-route","priority":0,"plugins":{},"update_time":1710499244,"uri":"/headers","methods":["GET"]}}
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9080/headers";
   <html>
   <head><title>502 Bad Gateway</title></head>
   <body>
   <center><h1>502 Bad Gateway</h1></center>
   <hr><center>openresty</center>
   <p><em>Powered by <a 
href="https://apisix.apache.org/";>APISIX</a>.</em></p></body>
   </html>
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9180/apisix/admin/routes"; -X 
PUT   -H "X-API-KEY: ${ADMIN_API_KEY}"   -d '{
       "id": "proxy-rewrite-route",
       "methods": ["GET"],
       "uri": "/headers",
       "plugins": {
         "proxy-rewrite": {
           "host": "myapisix.demo"
         }
       },
       "upstream": {
         "type": "roundrobin",
         "nodes": {
           "httpbin.org:80": 1
         }
       }
     }';
   
{"key":"/apisix/routes/proxy-rewrite-route","value":{"status":1,"create_time":1710499147,"upstream":{"pass_host":"pass","nodes":{"httpbin.org:80":1},"hash_on":"vars","type":"roundrobin","scheme":"http"},"id":"proxy-rewrite-route","priority":0,"plugins":{"proxy-rewrite":{"use_real_request_uri_unsafe":false,"host":"myapisix.demo"}},"update_time":1710499254,"uri":"/headers","methods":["GET"]}}
   root@DESKTOP-F0LS87N:~# curl "http://127.0.0.1:9080/headers";
   {
     "headers": {
       "Accept": "*/*",
       "Host": "myapisix.demo",
       "User-Agent": "curl/7.68.0",
       "X-Amzn-Trace-Id": "Root=1-65f425b9-6aea290363a3d9e724620d9e",
       "X-Forwarded-Host": "127.0.0.1"
     }
   }
   root@DESKTOP-F0LS87N:~#
   ```
   
   


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