Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Apache Dispatcher overwrites responses with 500 status code

Avatar

Level 1

I have a AEM author instance that sits behind an apache server with the dispatcher module.  This has been setup and working for a long time.  I have reviewed various forum threads on the subject.

The problem I just discovered is that wcm commands that send an error back to the client using HtmlStatusResponseHelper are being over written by apache.

When I access AEM instance directly and the wcm command sends an error message, with a response error code of 500, I can see the text as a pop up message in the siteadmin.

In the same scenario, When I access AEM instance through apache, the content is overwritten by apache's internal server html content.

I have tried finding a way to disable apache's error code handling and prevent the overwrite of the html content generated by AEM.

How can the AEM generated 500 error content be returned through apache ?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

do you have an errordocument configured for the complete apache host/virtual host [1]? In that case AEM returns an error, and the webserver rewrites the response, so you can see the behaviour you described.

In that case it would make sense to limit the scope of the ErrorDocument statement to <Location>s which do not cover /bin/wcmcommand.

Jörg

 

[1] https://httpd.apache.org/docs/2.4/custom-error.html

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi,

do you have an errordocument configured for the complete apache host/virtual host [1]? In that case AEM returns an error, and the webserver rewrites the response, so you can see the behaviour you described.

In that case it would make sense to limit the scope of the ErrorDocument statement to <Location>s which do not cover /bin/wcmcommand.

Jörg

 

[1] https://httpd.apache.org/docs/2.4/custom-error.html