I have an Ubuntu Server 14.04 with Apache 2.4.7 and Wildfly 8 installed. Apache runs in the front and Wildfly in the back. Apache proxies all the apps running on Wildfly.
Now I am trying to proxypass one of my apps from Wildfly with the domain
mysubdomain.example.com, but I have unwanted side effects. It adds itself to the main domain
example.com/mysubdomain as well, which is not what I want. First I added this configuration to
<VirtualHost *:80> ServerName mysubdomain.example.com ServerAlias www.mysubdomain.example.com ProxyPass / http://localhost:8080/myapp/ ProxyPassReverse / http://localhost:8080/myapp/ </VirtualHost>
Then I added the same for SSH in
<VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/ssl/certs/mysubdomain.mydomain.crt SSLCertificateKeyFile /etc/ssl/private/mysubdomain.mydomain.key ServerName mysubdomain.example.com ServerAlias www.mysubdomain.example.com ProxyPass / http://localhost:8080/myapp/ ProxyPassReverse / http://localhost:8080/myapp/ </VirtualHost>
This configuration does not work like this. I was forced to add another configuration in order to make this work. I had to add into
<Location "/myapp/"> ProxyPass "http://localhost:8080/myapp/" ProxyPassReverse "http://localhost:8080/myapp/" </Location> <Location "/myapp"> ProxyPass "http://localhost:8080/myapp" ProxyPassReverse "http://localhost:8080/myapp" </Location>
This works (the good thing):
This comes with it (the bad thing):
What must I do to only affect the
subdomain without adding anything to the main domain?