3

The following returns a gateway timeout on my vps (debian, squeeze)

 curl --head http://www.flipkart.com/
 HTTP/1.1 504 Gateway Timeout

But works fine i.e gives a 302 HTTP on my home computer. So I guess something is wrong in my vps settings. But what?

The same command was working fine yesterday.

Help!

Edit: PHP-cURL throws a 504 as well, which is how this problem was discovered..

Edit2: Other sites work just fine though:

 curl --head https://google.com 

Edit3: I can successfully ping to flipkart.com

4
  • Why do you think this is a problem with your VPS? Sep 25, 2014 at 13:40
  • same command works fine i.e gives a 200 HTTP from my home computer.
    – gyaani_guy
    Sep 25, 2014 at 13:45
  • That's funny, because I get an instant 504 error. Which means the remote site is doing something stupid. This isn't your problem. Sep 25, 2014 at 13:46
  • But if the remote site can be accessed with a browser, it should be accessible from curl as well . right ?
    – gyaani_guy
    Sep 25, 2014 at 13:51

1 Answer 1

2

Figured it out!! It was giving 504 when curl tries to resolve to ipv6

On comparing the requests, the only difference was the ip address.

So I tried forcing ipv4 resolving via

curl -4 --head  http://www.flipkart.com

and it worked!

2
  • See, I told you the remote site was doing something stupid. :) Sep 25, 2014 at 14:06
  • Indeed. My solution is more like a workaround.
    – gyaani_guy
    Sep 25, 2014 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .