jQuery AJAX request fails with 503 error only with “http://example.com” as value

左心房为你撑大大i 提交于 2019-12-13 01:07:39

问题


I have the strangest problem. This is my javascript:

var value = "some_value";
$.ajax({
  url: "process.php",
  type: "POST",
  dataType: "json",
  data: {
    value: value
  },
  success: function(data) {
    console.log(data);
  }
});

No surprises here. This is my process.php:

<?php exit; ?>

Actually it does not matter, what is inside the process.php. The request is successful everytime, except when value is a valid URL. With

var value = "http://example.com"

at the beginning the request will fail with error 503 Service temporarily unavailable. What is wrong with my server configuration? I don't know what to try. I have no .htaccess. Browser: Firefox 29.


回答1:


This is almost certainly a web application firewall. Check whether your server is running mod_security. You will need to review the rules used by mod_security or whatever else is running on the server to find the one that is blocking URLs.



来源:https://stackoverflow.com/questions/23582490/jquery-ajax-request-fails-with-503-error-only-with-http-example-com-as-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!