HTTP 308 错误永久重定向 (Permanent Redirect)
测试环境访问另一个系统时报错
使用curl 测试
curl --location --request POST 'http://xxxxx.cn/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "admin",
"password": "123456"
}'
curl: (60) SSL certificate problem: self-signed certificate
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
结果说是证书问题 因为请求里面用的是http 测试环境没有配置
然后使用-k还会出现别的错误就不再演示
正确配置
让 xxxx.cn 这个域名指向 192.168.1.156 这个 IP 地址
vim /etc/hosts
192.168.1.156 xxxx.cn