Dispatcher configuration for multiple site running on same domain | Community
Skip to main content
ravir73578276
Level 3
June 29, 2023
Solved

Dispatcher configuration for multiple site running on same domain

  • June 29, 2023
  • 2 replies
  • 1107 views

I have my AEM instance running on IP  20.220.175.100:4502 . Also I have another vue js application running on the same server  20.220.175.100:3000.

Both the applications (aem and vuejs) have same Domain www.myappdomain.com

 

How can I do dispatcher configuration , such that when I hit www.myappdomain.com/myproject/home it should point to renderer 20.220.175.100:4502

and when I hit www.myappdomain.com/myproject/vujs/app.json it should point to renderer 20.220.175.100:3000

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrianKasingli

You can try using the Apache Web Server's features, Proxy Pass

<VirtualHost *:80> ServerName www.myappdomain.com ProxyRequests Off ProxyPreserveHost On # Route /myproject/home to AEM instance ProxyPass /myproject/home http://20.220.175.100:4502/ ProxyPassReverse /myproject/home http://20.220.175.100:4502/ # Route /myproject/vuejs/app.json to Vue.js application ProxyPass /myproject/vuejs/app.json http://20.220.175.100:3000/ ProxyPassReverse /myproject/vuejs/app.json http://20.220.175.100:3000/ </VirtualHost>

2 replies

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
June 29, 2023

You can try using the Apache Web Server's features, Proxy Pass

<VirtualHost *:80> ServerName www.myappdomain.com ProxyRequests Off ProxyPreserveHost On # Route /myproject/home to AEM instance ProxyPass /myproject/home http://20.220.175.100:4502/ ProxyPassReverse /myproject/home http://20.220.175.100:4502/ # Route /myproject/vuejs/app.json to Vue.js application ProxyPass /myproject/vuejs/app.json http://20.220.175.100:3000/ ProxyPassReverse /myproject/vuejs/app.json http://20.220.175.100:3000/ </VirtualHost>
Tanika02
Level 7
June 29, 2023

Hello @ravir73578276 - 

 

To configure the dispatcher in AEM to handle requests for different paths and route them to the appropriate renderers, you can follow these steps:

 

1. Open the `dispatcher.any` file located in the dispatcher configuration directory (`/etc/apache2` or `/conf`). This file contains the configuration rules for the dispatcher.

 

2. Add the following rules to the `dispatcher.any` file:

/myproject/home { /type "allow" /url "http://20.220.175.100:4502" } /myproject/vuejs/app.json { /type "allow" /url "http://20.220.175.100:3000" }



These rules define the mapping for the specific paths to the respective renderers.

3. Save the dispatcher.any file and restart the Apache web server to apply the changes.

 

With this configuration, when you access `www.myappdomain.com/myproject/home`, the request will be routed to the AEM renderer at `20.220.175.100:4502`. Similarly, when accessing `www.myappdomain.com/myproject/vuejs/app.json`, the request will be routed to the Vue.js application running at `20.220.175.100:3000`.

 

Note: This configuration assumes that you have already set up the necessary DNS and network configurations to map `www.myappdomain.com` to the IP address of your server.