Hi,
My requirement is to use Akamai as CDN for my AEMaaCS project.
Followed this documentation from Adobe CDN in AEM as a Cloud Service | Adobe Experience Manager.
Akamai we configured as per the sample vendor configurations.
I created a edge key and deployed it through cdn.yaml file (attached screenshot) as a secret type environment variable. Same key we are passing as X-AEM-Edge-Key header from Akamai.
1) When I try to run the curl command << curl https://publish-p<PROGRAM_ID>-e<ENV-ID>.adobeaemcloud.com -v --header "X-Forwarded-Host: example.com" --header "X-AEM-Edge-Key: <PROVIDED_EDGE_KEY>" --header "x-aem-debug: edge=true" >>
the response is 302, and the X-Forwarded-Host expected value in response header is the domain, but it is returning publisher url (in 'x-aem-debug' response header).
2) When I try to run the curl command << curl https://publish-p<PROGRAM_ID>-e<ENV-ID>.adobeaemcloud.com/content/example-homepage.html -v --header "X-Forwarded-Host: example.com" --header "X-AEM-Edge-Key: <PROVIDED_EDGE_KEY>" --header "x-aem-debug: edge=true" >>
the response is 200. This url is the publish url for the homepage of the project(with /content path).
and X-Forwarded-Host expected value in response header is the domain, but it is returning publisher url (in 'x-aem-debug' response header).
3) When I try to run the curl command << curl https://example.com -v --header "X-Forwarded-Host: example.com" --header "X-AEM-Edge-Key: <PROVIDED_EDGE_KEY>" --header "x-aem-debug: edge=true" >>
the response is 200. Here, X-Forwarded-Host is returning example.com , and host=example.com (in 'x-aem-debug' response header)
What is the problem happening in here, am I missing any steps?
Or is the Akamai configuration wrong?
DNS I am yet to configure, to point the domain to Akamai edge server instead of publish url.
Am I testing the connectivity correct? Please guide me through this issue.
Thanks,
Ranjith
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @RanjithR1,
did you create a farm file in the Dispatcher configuration with example.com domain listed under /virtualhosts?
Check the Dispatcher logs to make sure your request is hitting the correct farm.
Something seems to be misconfigured on your end, as we use Akamai and the same approach of passing edge key and the forwarded host to the Dispatcher.
BR,
Daniel
Views
Replies
Total Likes
Hi @daniel-strmecki
Yes, I have a farm file and vhost for the project. And all the rewrites and rules are correctly working with the hostname mentioned in the virtualhost except Akamai.
Regards,
Ranjith
Views
Replies
Total Likes
Hi @daniel-strmecki
During troubleshooting, allowed X-Forwarded-Host header in clientheaders, DispatcherUseForwardedHost - Set to On.
Curl command is returning 302 still, and the X-Forwarded-Host response header in aem-debug, is showing the publish url, not the domain.
Is testing through the curl command correct way? (as shown in documentation)
Or should we point our domain dns to akamai edge server and test like that?
Views
Replies
Total Likes
Hi @RanjithR1,
If CURL is returning 302, check if you have a redirect to the homepage, like /global/en, in that case, this is expected. Try to add the correct page path to your request, for example:
curl -I https://publish-pXXXX-eXXXX.adobeaemcloud.com/global/en -H "X-Forwarded-Host: my-domain.com" -H "X-Edge-Key: XXXXXXXXX" -H "x-aem-debug: edge=true"
In my case the x-aem-debug shows: host=publish-pXXXX-eXXXX.adobeaemcloud.com,x-forwarded-host=my-domain.com
I suggest you check the Dispatcher logs with DEBUG level.
Good luck,
Daniel
Views
Replies
Total Likes
Hi @daniel-strmecki
I tried a curl command similar to this, where the request is not sent to direct publish url, instead publish url with a content path.
There we are getting a 200 as expected, not 302.
curl https://publish-pXXXXXX-eXXXXXX.adobeaemcloud.com/content/project/home.html -I --header "X-Forwarded-Host: example.com" --header "X-AEM-Edge-Key: ABC123" --header "x-aem-debug: edge=true"
But here also, in my case the x-aem-debug shows: host=publish-pXXXX-eXXXX.adobeaemcloud.com,x-forwarded-host=publish-pXXXX-eXXXX.adobeaemcloud.com.
Here we are expecting x-forwarded-host=example.com.
As you suggested, I checked Dispatcher DEBUG level logs. Couldn't find this header in the logs. These custom headers are allowed in clientheaders.any also.
Not sure what is the issue.
Views
Replies
Total Likes
Hi @RanjithR1,
That is strange, but you don't need to add it to "client headers" as this defines a list of headers to be passed through to AEM. In my project, I don't have any custom Dispatcher configuration added to make "X-Forwarded-Host" work; this should be OOTB.
BR,
DAniel
Views
Replies
Total Likes