imperium2335 Posted August 2, 2009 Share Posted August 2, 2009 Hi, I'm trying to use CURL to scape pages. But the odd few sites return a blank page with a big "Bad Request 400" at the top of the page and below it in small writting I see "nginx" (I know this because I've used echo to output the page). If I go to the page in my browser it exists and looks fine. Anyone know what or how to fix this? I'm using the following CURL stuff: $ch=curl_init(); curl_setopt($ch,CURLOPT_USERAGENT,$agents[rand(0, 4)]) ; curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE) ; curl_setopt($ch,CURLOPT_URL,$urltoscan); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,20); //Time out after 20 seconds. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Return the page as a string. $currentsite = curl_exec($ch); //Execute above commands. curl_close($ch); echo $currentsite ; What is nginx? Link to comment https://forums.phpfreaks.com/topic/168468-curl-bad-request-nginx/ Share on other sites More sharing options...
bonaparte Posted August 2, 2009 Share Posted August 2, 2009 From the Wikipedia <quote> nginx (pronounced as "engine X") is a lightweight, high performance web server/reverse proxy </quote> Link to comment https://forums.phpfreaks.com/topic/168468-curl-bad-request-nginx/#findComment-888722 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.