Apache覆盖500个HTTP状态代码响应

Apache覆盖500个HTTP状态代码响应,apache,http,status,Apache,Http,Status,我使用Apache作为代理服务器。当我的web应用程序发送500个错误代码作为对AJAX调用的响应时,apache会显示它自己的默认内部错误消息 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head><body> <h1>Intern

我使用Apache作为代理服务器。当我的web应用程序发送500个错误代码作为对AJAX调用的响应时,apache会显示它自己的默认内部错误消息

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 you@example.com and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>

500内部服务器错误
内部服务器错误
服务器遇到内部错误或错误
配置错误,无法完成
你的要求

请与服务器管理员联系, you@example.com并通知他们错误发生的时间, 你可能做的任何事都可能 导致错误的原因

有关此错误的详细信息,请参阅 在服务器错误日志中


有没有办法避免这种情况,这样apache服务器就不会改变错误响应。

检查您的httpd.conf文件以了解apache存储错误的位置。 然后,您可以
tail error.log
查看最近的错误,或
cat error.log
查看所有错误

如果没有错误,
vim officing.file.ext
查看是否有任何错误。可能是行尾或语法错误


否则,我建议让我们看看代码。

我有一个类似的问题,我在使用代码:(PHP)

而不是

header("HTTP/1.0 500 Internal Server Error");
第一个在我的本地XAMPP服务器上工作,但在某些其他服务器上不工作,而是切换到HTTP/1.0响应在这两个服务器上都工作

header("HTTP/1.0 500 Internal Server Error");