0

I'm having the HTTP Error 504.0 error in my application.

Architecture.

I mounted a REST API using Slim on the server X (on the web). When I make any request to this API from my computer the API returns me the data almost instantly. That is, it works correctly.

However, when I try to interact with the API through a PHP application via AJAX that I also mounted, being hosted on another server from another domain the error happens.

enter image description here

NTI
  • 83
  • 1
  • 10
  • Just seems to be a cross-origin problem. Allow in the server to get requests from another domain. You can set a php header for this `header("Access-Control-Allow-Origin: origin`. See more: http://stackoverflow.com/questions/8719276/cors-with-php-headers#9866124 – Marcos Pérez Gude Apr 12 '17 at 11:36
  • Possible duplicate of [CORS with php headers](http://stackoverflow.com/questions/8719276/cors-with-php-headers) – Marcos Pérez Gude Apr 12 '17 at 11:37
  • Thanks, but is not CORS :( – NTI Apr 12 '17 at 11:40
  • Ok, you're right. Maybe this helps you: http://stackoverflow.com/questions/261536/http-status-504 – Marcos Pérez Gude Apr 12 '17 at 11:46
  • Yeah Marcos, but not. Cause my request "localhost->API" its really fast. 169ms / Size: 428B :( – NTI Apr 12 '17 at 11:54
  • Have you got a firewall or something that can block requests? If yes you can try to allow all connections from the app IP to the API IP. I feel that I can't help you better :( – Marcos Pérez Gude Apr 12 '17 at 13:27
  • @MarcosPérezGude I dont know cause i just buy the host service, its not "mine". But i can make localhost requests. So, not looks its firewal. – NTI Apr 12 '17 at 13:39
  • This is a really hard question :'( – NTI Apr 12 '17 at 13:39
  • It doesn't matter. Can be the firewall. If the firewall blocks an IP, that iP will be unable to access to server, but if you change the IP or the machine you will get access with no problem. You can try to talk to your host provider if they have installed firewall or another security methods that can block access from another server, or where you can see iptables and so on. However, I don't tell you that's the reason of your problem, but you need to try something to see what's wrong on your system. – Marcos Pérez Gude Apr 12 '17 at 13:51

0 Answers0