membphis commented on issue #2745:
URL: https://github.com/apache/apisix/issues/2745#issuecomment-727222169


   Here is my steps:
   
   ```shell
   # set route with healthcheck(host is foo.com)
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/hello",
       "upstream": {
            "nodes": {
               "127.0.0.1:1980": 1,
               "127.0.0.2:1981": 1
           },
           "type": "roundrobin",
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "host": "foo.com",
                   "healthy": {
                       "interval": 1,
                       "successes": 2
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   }
               }
           }
       }
   }'
   
   # call the API
   curl http://127.0.0.1:9080/hello
   
   # set a new route with healthcheck(host: xxxx.com)
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/hello",
       "upstream": {
            "nodes": {
               "127.0.0.1:1980": 1,
               "127.0.0.2:1981": 1
           },
           "type": "roundrobin",
           "retries": 2,
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "host": "xxxx.com",
                   "healthy": {
                       "interval": 1,
                       "successes": 2
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   }
               }
           }
       }
   }'
   
   # call the API again
   curl http://127.0.0.1:9080/hello
   
   # then shutdown the upstream server, check the error log
   kill your-upstream-pid
   tail logs/error.log
   
   
![image](https://user-images.githubusercontent.com/6814606/99150496-f70f6880-26cf-11eb-80d7-ea7f25f9cb8c.png)
   
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to