external network access domain name: https://api.baidu.com
internal network domain name: http://local.baidu.com
this domain name is inaccessible outside the network! It is 127.0.0.1
I use nginx reverse proxy to access the intranet and set up a cookie, domain in the same domain / .baidu.com. I can test it in the local browser! However, the cookie is set successfully when accessing the public network https://api.baidu.com
. Then, when you request through the www.baidu.com API, you actually go to the private network local.baidu.com, but if you can"t get the cookie in the local.baidu.com, you jump to api.baidu.com for authorization. The result is that the cookie is always looped to check for authorization. But it just didn"t work! How to deal with it like this!
simply draw a picture! That"s how it works!