I am trying to setup httpd.conf properly but regardless of the sub-domain/domain combo below, they all resolve to the same internal URL.
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
ProxyRequests Off
<VirtualHost *:80>
Servername jira.firstfactoryinc.com
ProxyPreserveHost On
ProxyPass / http://localhost:8082/
ProxyPassReverse / http://localhost:8082/
</VirtualHost>
<VirtualHost *:80>
Servername jira.submitpatientforms.com
ProxyPreserveHost On
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/
</VirtualHost>
<VirtualHost *:80>
Servername mddev-jira.firstfactoryinc.com
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
What am I doing wrong?
You'll need a
NameVirtualHost
directive that matches your<VirtualHost>
definitions, or else the first<VirtualHost>
block to load will be used for all requests on that port (this matches with what you're seeing, correct?).In the case of the config above:
Outside of a
VirtualHost
block. Alongside yourListen
directive is a good place for it.You may have to add something like this within each VirtualHost, I did:
Obviously that can be modified to suit your security needs.
You may also want to add:
It is supposed to be the default, but depending on your Apache version and mod_proxy version something could be acting up.