I have been researching for days to include subdomain specific configuration files in subdomain virtual host configuration that is in main server configuration file. My overall goal is to add proxy pass and proxy pass reverse configuration that are different in each subdomain. For example: I want sub1.domain.com to act as proxy server of tomcat server that is running in localhost port 8080 and sub2.domain.com of another tomcat running in 8081. But cpanel generated httpd.conf file doesn't allow to add subdomain specific configuration files. For example: here's my httpd.conf file.
Notice the include directory is same for all subdomain's virtual host configuration. So if I add a subdomain specific proxy configuration file in above directory, that configuration is included in all virtualhost. I also couldn't achieve proxy configuration using .htaccess. So the only option I think I have is to edit vhost.default template which seems little complicate for me. Is there any other solution of this problem beside customizing vhost template?
<VirtualHost *:80> ServerName sub1.domain.com ServerAlias www.sub1.domain.com ... Include "/usr/local/apache/conf/userdata/std/2/domain/*.conf" </VirtualHost> <VirtualHost *:80> ServerName sub2.domain.com ServerAlias www.sub2.domain.com ... Include "/usr/local/apache/conf/userdata/std/2/domain/*.conf" </VirtualHost>