I need to tell nginx to handle requests from IE 6 & 7 differently than all other browsers. So I've written a small check to rewrite the request in nginx:
if (\$http_user_agent ~ "MSIE [67]\.") {
rewrite ^ ${ROOT_ROOT}ancient/ last;
break;
}
At work, we use browserstack for cross-browser testing. But since that's a pretty slow way to test small changes across various configurations, I wrote a test script that executes a bunch of cURL requests with different User Agent strings, to make sure the server returns the desired content.
Here's an example of a curl execution, with UA spoofing:
curl -LvA 'Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)' http://localhost:8008/"
Anyway, problem is, I'm not seeing the same behavior when I use cURL with the exact UA string from the Browserstack environment, as when I try to access the page with Browserstack directly.
It's very strange. Because on browserstack, the server doesn't even recognize the request (and the browser says there are connection issues), whereas with cURL, the proper content is loaded and the server returns 200.
I don't expect anyone to solve my problem entirely here, but I'm trying to figure out if there are limitations to cURL I don't know about.
Thanks in advance.