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!
Solved! Go to Solution.
Views
Replies
Total Likes
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).
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).
Views
Likes
Replies
Views
Likes
Replies