My front end web app is using jQuery’s AJAX functions ($.ajax, $.getJSON, $.post) to call a back end data API via GET and POST requests. In the browser console and in the Heroku app’s logs I can see the calls are rejected with an HTTP status of 444, which is an Nginx custom status:
Used in Nginx logs to indicate that the server has returned no information to the client and closed the connection (useful as a deterrent for malware).
(though it doesn’t necessarily mean they’re running Nginx or that this is due to Nginx)
Anyone know why this would occur or how I can remedy it? The calls are nothing fancy – here’s an example coffeescript:
jQuery ($) ->
tbody = $("table#top_five_table > tbody")
$.ajaxSetup(
dataType: "json"
)
$.getJSON url, (data, status, xhr) => [
tbody.empty().html( data_munging(data) )
]
Everything works locally, but obviously I’m not running it with an Nginx proxy (as I assume Heroku are). The request headers locally and on the Heroku instance appear identical.
Any help or insight will be much appreciated.
The shame of it – I found some code that checks for the referrer and will take certain actions to allow/deny routes depending on that, and localhost is bypassed hence it always working. So it’s a bug.
Because I’ve offered a bounty I don’t seem to be able to close the question so I’m answering it. Thanks to all who spent any time looking into this.