From fa8ed7281294838a4d6f6a052f33bf9cbf7032db Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 29 Jan 2017 21:00:22 +0100 Subject: [PATCH] dyn.manpages.d.o: let auxserver handle redirects, serve static assets --- .../manpages/dyn.manpages.debian.org.erb | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/modules/roles/templates/manpages/dyn.manpages.debian.org.erb b/modules/roles/templates/manpages/dyn.manpages.debian.org.erb index ea9237c65..076e205ca 100644 --- a/modules/roles/templates/manpages/dyn.manpages.debian.org.erb +++ b/modules/roles/templates/manpages/dyn.manpages.debian.org.erb @@ -11,22 +11,38 @@ Use common-debian-service-https-redirect * dyn.manpages.debian.org ErrorLog /var/log/apache2/dyn.manpages.debian.org-error.log CustomLog /var/log/apache2/dyn.manpages.debian.org-access.log privacy - # URLs which end in a slash do not need to be rewritten - RewriteEngine on - RewriteRule ^(.*/)$ "https://manpages.debian.org$1" [R=307,L] - - # Redirect fully qualified URLs to the correct host. - RewriteCond "/srv/manpages.debian.org/www/%{REQUEST_FILENAME}" "-f" [OR] - RewriteCond "/srv/manpages.debian.org/www/%{REQUEST_FILENAME}.gz" "-f" - RewriteRule "^/(.*)" "https://manpages.debian.org/$1" [R=307,L] - - # Use the correct host in redirects - Header edit Location "^/" "https://manpages.debian.org/" - - + DocumentRoot /srv/manpages.debian.org/www + + + Require all granted + AllowOverride none + + ExpiresActive On + ExpiresDefault "access plus 1 hours" + + + Order allow,deny + Deny from all + + + # To set the correct Content-Type (e.g. text/html). + RemoveType .gz + AddEncoding gzip gz + FilterDeclare gzip CONTENT_SET + FilterProvider gzip inflate "%{req:Accept-Encoding} !~ /gzip,.*gzip/" + FilterChain gzip + Options +Multiviews + + + ProxyPass "http://localhost:2431/" ProxyPassReverse "http://localhost:2431/" + + # Use the correct host in redirects + Header edit Location "^/" "https://manpages.debian.org/" + + ErrorDocument 404 /auxserver%{REQUEST_URI}?%{QUERY_STRING} # vim:set syn=apache: -- 2.20.1