Tenho um servidor apache atuando como proxy reverso para um webservice, com uma configuração parecida com esta:
<VirtualHost *:18010>
SSLEngine on
ProxyRequests off
SSLProxyEngine on
ProxyPass / https://backend.url:4445/
ProxyPassReverse / https://backend.url:4445/
SSLVerifyClient require
SSLVerifyDepth 10
SSLCACertificateFile ssl/cacerts.pem
</VirtualHost>
O que está funcionando bem. No entanto, quando os "clientes" executam consultas no WebService em execução por trás da URL, se o backend responde um erro, o proxy mostra apenas que houve um erro 500, como:
<!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 at
[email protected] to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
Enquanto que ao consultar o WebService "diretamente" (não via proxy) podemos ver o erro "real" retornado pelo servidor, como:
Error 500: javax.servlet.ServletException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "test" (Class iseries.wsbeans.avews10.PrecheckInput), not marked
at [Source: com.ibm.ws.webcontainer.srt.SRTInputStream@6bd1f156; line: 1, column: 11] (through reference chain: iseries.wsbeans.avews10.PrecheckPaymentInput["test"])
Então minha pergunta é: existe uma opção para adicionar a configuração do Apache para que ele retorne o erro completo retornado pelo backend, em vez de apenas um erro 500?
obrigado novamente, cumprimentos,
Desabilite a substituição da página de erro do Apache para permitir que o erro real seja retornado ao cliente.
https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxyerroroverride