I have 2 servers: app1.example.biz & app2.example.biz I need to do the following using apache2 as a reverse proxy redirect all traffic coming from internet to the appropriate server & use ssl. The configuration i did allows me to redirect app1.example.biz to https app1.example.biz & i can access the server. The problem is that i can't do the same for app2.example.biz, when i type app2.example.biz it redirects me to https app1.example.biz!! PS: I can't post more than two hyperlinks because i'm a new user but my config is correct.
<VirtualHost *:80> ServerName app1.example.biz/ Redirect / https app1.example.biz/ </VirtualHost> <VirtualHost *:443> ServerName app1.example.biz ServerAlias app1.example.biz ProxyPass / http app1.example.biz/ ProxyPassReverse / http app1.example.biz/ SSLEngine on SSLCertificateFile /etc/ssl/servwiki.crt SSLCertificateKeyFile /etc/ssl/servwiki.key SSLVerifyClient none </VirtualHost> #<VirtualHost *> # ServerName app2.example.biz/ # Redirect / https app2.example.biz/ #</VirtualHost> <VirtualHost *> ProxyPreserveHost On ServerName app2.example.biz ServerAlias app2.example.biz ProxyPass / http app2.example.biz/ ProxyPassReverse / http app2.example.biz/ SSLEngine on SSLCertificateFile /etc/ssl/servwiki.crt SSLCertificateKeyFile /etc/ssl/servwiki.key SSLVerifyClient none </VirtualHost>
I tried: 1/ using NameVirtualHost:80 & NameVirtualHost:443 2/Naming each virtual host like this 3/adding
<VirtualHost *> ServerName www.example.biz DocumentRoot /usr/local/apache/htdocs #SSLEngine on #SSLCertificateFile /etc/ssl/servwiki.crt #SLCertificateKeyFile /etc/ssl/servwiki.key #SSLVerifyClient none </VirtualHost>
this solves the problem of redirecting http app1.example.biz & http app2.example.biz to the corresponding server but it doesn't wok with ssl!
plzzzzz help