From 6e738007029f47e0bc0dafdf76ccc7089eeb4ad9 Mon Sep 17 00:00:00 2001 From: Alex Dehnert Date: Sat, 7 Aug 2021 14:42:56 -0400 Subject: [PATCH] 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. --- sites-available/mit-proxy.conf | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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] -- 2.34.1