关于curl或者file_get_contents爬取问题,求大神
是这样的,我有一个域名叫 www.abc.com
public function tokentest(){
$url="https://www.baidu.com/";
$data=file_get_contents($url);
print_r($data);
}
当域名是 www.abc.com的时候无论用curl或者file_get_contents都可以正常爬取到https的内容
但是当正式环境是我的域名带有自己的端口 www.abc.com:8888
这时我在使用爬取方法的时候就会直接出现502错误,我觉得可能是这个端口8888的问题,我找了很多资料么有找到,有没有大神遇到过这种情况
以下是报错
502 Bad Gateway
The proxy server received an invalid response from an upstream server.