From: Alex Dehnert Date: Sat, 7 Aug 2021 18:42:56 +0000 (-0400) Subject: proxy: Fix exception for serving locally X-Git-Url: https://dehnerts.com/gitweb/?a=commitdiff_plain;h=6e738007029f47e0bc0dafdf76ccc7089eeb4ad9;hp=c2cf734cf95b69ecca998cfa684df1d6dfbf3928;p=sysconfig%2Fapache2.git proxy: Fix exception for serving locally 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. --- diff --git a/sites-available/mit-proxy.conf b/sites-available/mit-proxy.conf index aefcfae..7874705 100644 --- a/sites-available/mit-proxy.conf +++ b/sites-available/mit-proxy.conf @@ -30,17 +30,13 @@ 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]