diff options
author | Wojtek Kosior <koszko@koszko.org> | 2023-09-05 14:27:58 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2023-09-07 12:12:59 +0200 |
commit | 18da556c5cb0234a4c1ad3df0b263a452db2ebf1 (patch) | |
tree | 6f85edde0b073de476784d87a0a6ba4234d84f06 /container.scm | |
parent | 7fe30d5b5e22818712b90664d905483ea3fe54c3 (diff) | |
download | koszko-org-server-18da556c5cb0234a4c1ad3df0b263a452db2ebf1.tar.gz koszko-org-server-18da556c5cb0234a4c1ad3df0b263a452db2ebf1.zip |
Serve archived hydrillabugs.koszko.org website
Diffstat (limited to 'container.scm')
-rw-r--r-- | container.scm | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/container.scm b/container.scm index 9f51721..d57b565 100644 --- a/container.scm +++ b/container.scm @@ -232,27 +232,38 @@ (koszko-httpd-site-conf (name-and-aliases (list "hydrillabugs.koszko.org" "hachettebugs.koszko.org")) (body - `(;; GDPR hack - ,(httpd-directive 'Header 'unset 'Set-Cookie) + `(,(httpd-directive 'DocumentRoot "/srv/http/hydrillabugs.koszko.org") - ,(httpd-tag 'Proxy '("*") - (httpd-directive - 'Redirect 'permanent - "/projects/hachette" "/projects/haketilo") - ;; I don't remember why I added the following line so I'm - ;; keeping it just in case. - (httpd-directive 'RequestHeader 'unset 'Accept-Encoding)) + ,(httpd-directive 'RewriteEngine 'On) - ,(httpd-directive - 'ProxyPass "/projects/haketilo" - "http://10.207.87.1:21011/projects/hachette") - ,(httpd-directive - 'ProxyPassReverse "/projects/haketilo" - "http://10.207.87.1:21011/projects/hachette") + ,(httpd-directive 'RewriteCond "%{REQUEST_METHOD}" "!GET") + ,(httpd-directive 'RewriteRule "^(.*)$" "/hydrillabugs-archived.html" + "[L,R=301,QSD]") + + ,(httpd-directive 'Alias "/hydrillabugs-archived.html" + (local-file "./hydrillabugs-archived.html")) + + ,(httpd-directive 'RewriteRule "/uri-map.txt" "/dummy" "[L,F]") + + ;; Serve wget-archived website. + ,(httpd-directive 'RewriteMap 'add-ext + "txt:/srv/http/hydrillabugs.koszko.org/uri-map.txt") + + ,(httpd-tag 'Location (list "/javascripts") + (httpd-directive 'ForceType "application/javascript")) + + ,(httpd-directive 'RewriteCond "%{QUERY_STRING}" "!^$") + ,(httpd-directive 'RewriteCond "${add-ext:$1?%{QUERY_STRING}|NONE}" + "!NONE") + ,(httpd-directive 'RewriteRule "^(.*)$" "${add-ext:$1?%{QUERY_STRING}}" + "[L,R=301]") + + ,(httpd-directive 'RewriteCond "%{QUERY_STRING}" "!^$") + ,(httpd-directive 'RewriteRule "^(.*)$" "$1?%{QUERY_STRING}?" "[L,QSL]") - ,(httpd-directive 'ProxyPass "/.well-known/acme-challenge/" "!") - ,(httpd-directive 'ProxyPass "/" "http://10.207.87.1:21011/") - ,(httpd-directive 'ProxyPassReverse "/" "http://10.207.87.1:21011/"))))) + ,(httpd-directive 'RewriteCond "%{QUERY_STRING}" "^$") + ,(httpd-directive 'RewriteCond "${add-ext:$1|NONE}" "!NONE") + ,(httpd-directive 'RewriteRule "^(.*)$" "${add-ext:$1}" "[L,R=301]"))))) (add-site-conf (koszko-httpd-site-conf @@ -338,10 +349,10 @@ (name "proxy_http_module") (file (file-append httpd "/modules/mod_proxy_http.so"))))) -(define %headers-module +(define %rewrite-module (httpd-module - (name "headers_module") - (file (file-append httpd "/modules/mod_headers.so")))) + (name "rewrite_module") + (file (file-append httpd "/modules/mod_rewrite.so")))) ;; logio is needed for the '%O' log format directive (define %logio-module @@ -372,7 +383,7 @@ (modules `(,%cgid-module ,%wsgi-module ,@%proxy-http-modules - ,%headers-module + ,%rewrite-module ,%logio-module ,@%default-httpd-modules)) (extra-config |