Tweaks to set up more hostnames
[sysconfig/apache2.git] / sites-available / mit-proxy.conf
index 3319b0bfa4a191583583cd89e44577598624d611..1ac172ff0d60223f09ecb977c00072ad297d8220 100644 (file)
@@ -6,8 +6,8 @@
 
 #<VirtualHost *:80>
 #    ServerName squaresdb.dehnerts.com
-#    ProxyPass "/"  "http://squaresdb.lushan-vms.dehnerts.com/"
-#    ProxyPassReverse "/"  "http://squaresdb.lushan-vms.dehnerts.com/"
+#    ProxyPass "/"  "http://squaresdb.augsburg.vms.dehnerts.com/"
+#    ProxyPassReverse "/"  "http://squaresdb.augsburg.vms.dehnerts.com/"
 #</VirtualHost>
 
 <IfModule mod_ssl.c>
     SSLProxyVerifyDepth 2
     SSLProxyCACertificatePath /etc/ssl/certs
     SSLProxyCheckPeerName on
-    ProxyPass "/"  "https://squaresdb.lushan-vms.dehnerts.com/"
-    ProxyPassReverse "/"  "https://squaresdb.lushan-vms.dehnerts.com/"
+    ProxyPass "/"  "https://squaresdb.augsburg.vms.dehnerts.com/"
+    ProxyPassReverse "/"  "https://squaresdb.augsburg.vms.dehnerts.com/"
     ProxyPreserveHost on
     Include sites-common/ssl-common
-    SSLCertificateFile /etc/letsencrypt/live/squaresdb.dehnerts.com/fullchain.pem
-    SSLCertificateChainFile /etc/letsencrypt/live/squaresdb.dehnerts.com/fullchain.pem
-    SSLCertificateKeyFile /etc/letsencrypt/live/squaresdb.dehnerts.com/privkey.pem
+    <IfFile "/etc/letsencrypt/live/squaresdb.dehnerts.com/">
+        SSLCertificateFile /etc/letsencrypt/live/squaresdb.dehnerts.com/fullchain.pem
+        SSLCertificateChainFile /etc/letsencrypt/live/squaresdb.dehnerts.com/fullchain.pem
+        SSLCertificateKeyFile /etc/letsencrypt/live/squaresdb.dehnerts.com/privkey.pem
+    </IfFile>
+    <IfFile ! "/etc/letsencrypt/live/squaresdb.dehnerts.com/">
+        #Warning "correct default cert not detected, falling back to snakeoil"
+        SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
+        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+    </IfFile>
 </VirtualHost>
 </IfModule>
 
 <VirtualHost *:80>
     ServerName zulip.dehnerts.com
     ServerAlias *.zulip.dehnerts.com
-    ProxyPassReverse "/"  "http://zulip.lushan-vms.dehnerts.com/"
+    ProxyPassReverse "/"  "http://zulip.augsburg.vms.dehnerts.com/"
     ProxyPreserveHost on
 
-    DocumentRoot /var/www/letsencrypt-verify/
+    DocumentRoot /var/www/html/
     RewriteEngine on
-    RewriteCond /var/www/letsencrypt-verify/%{REQUEST_URI} !-f
-    RewriteRule ^/.well-known/acme-challenge/(.*)$ http://zulip.lushan-vms.dehnerts.com/.well-known/acme-challenge/$1 [P,QSA,L]
+    RewriteCond /var/www/html/%{REQUEST_URI} !-f
+    RewriteRule ^/.well-known/acme-challenge/(.*)$ http://zulip.augsburg.vms.dehnerts.com/.well-known/acme-challenge/$1 [P,QSA,L]
 </VirtualHost>
 
 <IfModule mod_ssl.c>
     SSLProxyVerifyDepth 2
     SSLProxyCACertificatePath /etc/ssl/certs
     SSLProxyCheckPeerName on
-    ProxyPass "/"  "https://zulip.lushan-vms.dehnerts.com/"
-    ProxyPassReverse "/"  "https://zulip.lushan-vms.dehnerts.com/"
+    ProxyPass "/"  "https://zulip.augsburg.vms.dehnerts.com/"
+    ProxyPassReverse "/"  "https://zulip.augsburg.vms.dehnerts.com/"
     ProxyPreserveHost on
     Include sites-common/ssl-common
-    SSLCertificateFile /etc/letsencrypt/live/zulip.dehnerts.com/fullchain.pem
-    SSLCertificateChainFile /etc/letsencrypt/live/zulip.dehnerts.com/fullchain.pem
-    SSLCertificateKeyFile /etc/letsencrypt/live/zulip.dehnerts.com/privkey.pem
+    <IfFile "/etc/letsencrypt/live/zulip.dehnerts.com/">
+        SSLCertificateFile /etc/letsencrypt/live/zulip.dehnerts.com/fullchain.pem
+        SSLCertificateChainFile /etc/letsencrypt/live/zulip.dehnerts.com/fullchain.pem
+        SSLCertificateKeyFile /etc/letsencrypt/live/zulip.dehnerts.com/privkey.pem
+    </IfFile>
+    <IfFile ! "/etc/letsencrypt/live/zulip.dehnerts.com/">
+        #Warning "correct default cert not detected, falling back to snakeoil"
+        SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
+        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+    </IfFile>
 </VirtualHost>
 </IfModule>