问题
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