- 系统为MAC
- 环境为docker + mysql +php +nginx
问题描述
1.调试本地接口 方式为curl 请求 返回拒绝
业务上通过curl访问报错:“Couldn't connect to server: Failed to connect to *.com port 80: Connection refused”
2.postman 请求是正常的
解决方法
需要绑定nginx容器ip
a站点除了需要127.0.0.1 绑定虚拟域名。 在加上nginx 容器ip 绑定虚拟域名
b站同样 除了需要127.0.0.1 绑定虚拟域名。 在加上nginx 容器ip 绑定虚拟域名
a站点就可以通过curl 请求b站点接口了。
*hosts 文件中处理
特殊域名
localhost 也是需要绑定nginx容器ip



