Dispatcher configuration with virtualhost issue on port appending | Community
Skip to main content
Level 2
June 18, 2025
Solved

Dispatcher configuration with virtualhost issue on port appending

  • June 18, 2025
  • 3 replies
  • 650 views

Hi,

 

I'm trying to setup a new publish instance in aws linux machine. I have setup the aem publish environment and trying to access via the hostname.

 

So the Request flow is Dispatcher server -> ALB (Protocol port: 7000) -> AEM Publisher Server (App Instance running on 7000)

 

I have setup all the dispatcher configurations and routing the traffic through renders to the ALB on port 7000

 

When i access the host url lets say aempublish.com it's going to aempublish.com:7000/content/we-retail.html where the page is not loading. If i manually remove the port and hit url the page loads fine. I have setup the proxy and rewrite rules as well but still facing the same issue.

 

Checking the network the request is getting redirected twice with 302 status code

1) aempublish.com -> aempublish.com/index.html

2) aempublish.com/index.html -> aempublish.com:7000/content/we-retail.html

 

Dispatcher.any 

/virtualhosts {"aempublish.com"} /renders { /rend01 { /hostname "internal-uai100567-new-dev-live-publ-295647976.us-east-1.elb.amazonaws.com" /port "7000" }

 

Virtualhost configuration:

<VirtualHost *:443> ServerName aempublish.com DocumentRoot /opt/aem/cache/ ProxyPreserveHost On ProxyPass / http://10.227.230.195:7000/ retry=1 acquire=6000 timeout=600 keepalive=On ProxyPassReverse / http://10.227.230.195:7000/ <Directory "/opt/aem/cache/"> Require all granted </Directory> # Additional Dispatcher or cache configs here as needed <Directory /opt/aem/cache> AllowOverride None Options FollowSymLinks Require all granted <IfModule disp_apache2.c> SetHandler dispatcher-handler ModMimeUsePathInfo On </IfModule> </Directory> RewriteEngine On RewriteRule ^/$ /content/aem/global/en_us/home.html [PT,L] </VirtualHost>

Even without Including the VirtualHost config still by default the call is going to :7000/content/we-retail.html

 

Thanks in advance. Appreciate your inputs on this issue.

 

 

Best answer by Shashi_Mulugu

@vikramp8 if this is happening even without Vhost config,  i feel issue is somewhere in your publisher..

 

Have you checked your externalizer "Day CQ Link Externalizer"  or etc maps ? How's is it configured?

 

Publish domain should not contain port

3 replies

konstantyn_diachenko
Community Advisor
Community Advisor
June 18, 2025

Hi @vikramp8 ,

 

Your AEM Publish instance must know it’s behind HTTPS (via the dispatcher+ALB). You need to pass the right X-Forwarded-* headers, and configure AEM to honor them. Try to pass additional headers:

RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" RequestHeader set X-Forwarded-Host "aempublish.com" or RequestHeader set X-Forwarded-Proto "http" RequestHeader set X-Forwarded-Port "80" RequestHeader set X-Forwarded-Host "aempublish.com"

 

Kostiantyn Diachenko, Community Advisor, Certified Senior AEM Developer, creator of free AEM VLT Tool, maintainer of AEM Tools plugin.
VikramP8Author
Level 2
June 19, 2025

Hi @konstantyn_diachenko 

I have added the request header details as well. But still experiencing the same.

Thanks

Shashi_Mulugu
Community Advisor
Shashi_MuluguCommunity AdvisorAccepted solution
Community Advisor
June 19, 2025

@vikramp8 if this is happening even without Vhost config,  i feel issue is somewhere in your publisher..

 

Have you checked your externalizer "Day CQ Link Externalizer"  or etc maps ? How's is it configured?

 

Publish domain should not contain port

VikramP8Author
Level 2
June 19, 2025

Hi @shashi_mulugu 

below are the configurations setup in the externalizer

local http://localhost:7000

publish https://aempublish.com

Thanks

rahulp76079001
Level 2
June 19, 2025

Hi @vikramp8 ,

 

Try removing the port from 

ProxyPassReverse / http://10.227.230.195:7000/

Try using it like this

ProxyPassReverse / http://10.227.230.195/

 

 

Thanks