Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Add Custom Header in AEM Dispatcher Response

Avatar

Level 2

Hi all,

I am trying to add a custom HTTP response header from the dispatcher level in an AEM as a Cloud Service (AEMaaCS) setup.
I want this header to be included in responses served by Dispatcher for tracking/debugging purposes.

What’s the best way to do this in AEMaaCS with Dispatcher configuration?

I have tried editing the dispatcher.yaml but I’m not seeing the header added. Is there a specific file or directive I need to update? And are there any restrictions in AEMaaCS when adding custom headers?

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @NavyaVo,

To add a custom HTTP response header at the Dispatcher level, you'll need to update the Apache HTTPD configuration via the dispatcher.yaml or directly in a custom config under /conf.d.

Here's how you can do it:

Add Header Using Apache Directive

In your custom virtual host config (eg. *.vhost file under /conf.d/available_vhosts/), add:

<Directory />
    Header set X-Content-Source "AEM-Publish"
</Directory>

Or more specifically:

<VirtualHost *:80>
    ServerName www.example.com

    # Existing config...
    
    <Location />
        Header set X-Content-Source "AEM-Publish"
    </Location>

</VirtualHost>

Make sure you have mod_headers enabled (this is typically enabled by default in AEMaaCS Dispatcher SDK).


Santosh Sai

AEM BlogsLinkedIn


View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @NavyaVo,

To add a custom HTTP response header at the Dispatcher level, you'll need to update the Apache HTTPD configuration via the dispatcher.yaml or directly in a custom config under /conf.d.

Here's how you can do it:

Add Header Using Apache Directive

In your custom virtual host config (eg. *.vhost file under /conf.d/available_vhosts/), add:

<Directory />
    Header set X-Content-Source "AEM-Publish"
</Directory>

Or more specifically:

<VirtualHost *:80>
    ServerName www.example.com

    # Existing config...
    
    <Location />
        Header set X-Content-Source "AEM-Publish"
    </Location>

</VirtualHost>

Make sure you have mod_headers enabled (this is typically enabled by default in AEMaaCS Dispatcher SDK).


Santosh Sai

AEM BlogsLinkedIn