Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Dispatcher configuration for multiple site running on same domain

Avatar

Level 3

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

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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>

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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>

Avatar

Community Advisor

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.