Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

AEM cloud dispatcher farm files

Avatar

Level 2

can we keep common farm file code in a seperate file and reference it in siteA_farm.any and siteB_farm.any ?

 

Below document says we can have a 'includes' folder in conf.d folder .

Do we have similar for conf.dispatcher.d ?

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/con...

 

Topics

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

3 Replies

Avatar

Level 10

hi @VishnuRa5

Yes, you can absolutely keep common farm file code in a separate file and reference it in siteA_farm.any and siteB_farm.any.

For Dispatcher farm files (.any files in conf.dispatcher.d), you should use the $include directive, which is the Dispatcher-specific syntax for including files.

Here's a recommended file structure for sharing common farm configurations:

/etc/httpd/
├── conf.dispatcher.d/
│   ├── dispatcher.any
│   ├── available_farms/
│   │   ├── siteA_farm.any
│   │   ├── siteB_farm.any
│   │   └── common/
│   │       ├── common_filters.any
│   │       ├── common_clientheaders.any
│   │       ├── common_cache_rules.any
│   │       └── common_renders.any

Example siteA_farm.any:

/siteAfarm {
  /clientheaders {
    $include "/etc/httpd/conf.dispatcher.d/available_farms/common/common_clientheaders.any"
    $include "/etc/httpd/conf.dispatcher.d/clientheaders/siteA_clientheaders.any"
  }
  
  /virtualhosts {
    $include "/etc/httpd/conf.dispatcher.d/vhosts/siteA_vhosts.any"
  }
  
  /renders {
    $include "/etc/httpd/conf.dispatcher.d/available_farms/common/common_renders.any"
  }
  
  /filter {
    $include "/etc/httpd/conf.dispatcher.d/available_farms/common/common_filters.any"
    $include "/etc/httpd/conf.dispatcher.d/filters/siteA_filters.any"
  }
  
  /cache {
    /rules {
      $include "/etc/httpd/conf.dispatcher.d/available_farms/common/common_cache_rules.any"
    }
  }
}

 

For Apache configuration files (.conf.vhost files in conf.d), use the standard Apache Include or IncludeOptional directive:

/etc/httpd/
├── conf.d/
│   ├── available_vhosts/
│   │   ├── siteA.vhost
│   │   └── siteB.vhost
│   ├── enabled_vhosts/
│   │   ├── siteA.vhost -> ../available_vhosts/siteA.vhost
│   │   └── siteB.vhost -> ../available_vhosts/siteB.vhost
│   ├── rewrites/
│   │   ├── common_rewrites.rules
│   │   ├── siteA_rewrite.rules
│   │   └── siteB_rewrite.rules
│   └── variables/
│       ├── common.vars
│       ├── siteA.vars
│       └── siteB.vars

Example siteA.vhost:

Include /etc/httpd/conf.d/variables/common.vars
Include /etc/httpd/conf.d/variables/siteA.vars

<VirtualHost *:80>
    ServerName "${SITEA_DOMAIN}"
    
    <Directory />
        Include /etc/httpd/conf.d/rewrites/common_rewrites.rules
        
        <IfModule disp_apache2.c>
            SetHandler dispatcher-handler
        </IfModule>
    </Directory>
    
    <IfModule mod_rewrite.c>
        ReWriteEngine on
        LogLevel warn rewrite:trace1
        Include /etc/httpd/conf.d/rewrites/siteA_rewrite.rules
    </IfModule>
</VirtualHost>

 

To summarize, the conf.d folder does have an includes concept using Apache's native Include directive, while conf.dispatcher.d uses the Dispatcher-specific $include directive. Both approaches allow you to centralize common configurations and maintain DRY (Don't Repeat Yourself) principles across multiple sites.

 

Avatar

Level 4

Avatar

Employee

hello @VishnuRa5 

Yes, you can modularize your Dispatcher configuration by placing common code (such as filter rules, cache rules, or client headers) in separate files within their respective functional folders (e.g., conf.dispatcher.d/filters/, conf.dispatcher.d/cache/, etc.) and reference them in site-specific farm files using $include statements, though AEMaaCS enforces a strict directory and file naming structure for validation.

There is no special includes folder for conf.dispatcher.d; instead, common files must reside in allowed subdirectories (like filters or cache) and the $include path must match these folders exactly.