proxy: Fix exception for serving locally
authorAlex Dehnert <alex@dehnerts.com>
Sat, 7 Aug 2021 18:42:56 +0000 (14:42 -0400)
committerAlex Dehnert <alex@dehnerts.com>
Sat, 7 Aug 2021 18:42:56 +0000 (14:42 -0400)
Judging by
https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond,
REQUEST_FILENAME isn't available in a vhost, so we need to put the vhost root
before the REQUEST_URI.

sites-available/mit-proxy.conf

index aefcfae9929634a6ac409fcd7ebe4408d78ee890..7874705dd7e6f432a2a97d251696dc784d23a22d 100644 (file)
 
 <VirtualHost *:80>
     ServerName zulip.dehnerts.com
-    SSLProxyEngine on
-    SSLProxyVerify require
-    SSLProxyVerifyDepth 2
-    SSLProxyCACertificatePath /etc/ssl/certs
-    SSLProxyCheckPeerName on
-    ProxyPassReverse "/"  "https://zulip.lushan-vms.dehnerts.com/"
+    ProxyPassReverse "/"  "http://zulip.lushan-vms.dehnerts.com/"
     ProxyPreserveHost on
 
     DocumentRoot /var/www/letsencrypt-verify/
-    RewriteCond %{REQUEST_FILENAME} !-f
-    RewriteRule ^/.well-known/acme-challenge/(.*)$ https://zulip.lushan-vms.dehnerts.com/.well-known/acme-challenge/$1 [P,QSA,L]
+    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]
 </VirtualHost>
 
 <IfModule mod_ssl.c>