From 6de6c5f1817a1698e67256ba046c9f144e0c2482 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 21 Jul 2022 17:12:06 +0000 Subject: [PATCH] Override SubstituteMaxLineLength in PyPI proxies We've been getting the following error for some pages we're proxying today: AH01328: Line too long, URI /pypi/simple/grpcio/, While we suspect PyPI or its Fastly CDN may have served some unusual contents for the affected package indices, the content gets cached and then mod_substitute trips over the result because it (as of 2.3.15) enforces a maximum line length of one megabyte: https://bz.apache.org/bugzilla/show_bug.cgi?id=56176 Override that default to "5m" per the example in Apache's documentation: https://httpd.apache.org/docs/2.4/mod/mod_substitute.html Change-Id: I5351f0465287f695fb2f1957062182fd3bf6c226 --- playbooks/roles/mirror/templates/mirror.vhost.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playbooks/roles/mirror/templates/mirror.vhost.j2 b/playbooks/roles/mirror/templates/mirror.vhost.j2 index 44fa04e7fe..fe6e286df7 100644 --- a/playbooks/roles/mirror/templates/mirror.vhost.j2 +++ b/playbooks/roles/mirror/templates/mirror.vhost.j2 @@ -100,6 +100,7 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \ # Rewrite the locations of the actual files SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE + SubstituteMaxLineLength 5m Substitute "s|https://files.pythonhosted.org/|/pypifiles/|ni" @@ -251,6 +252,7 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \ # Rewrite the locations of the actual files SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE + SubstituteMaxLineLength 5m Substitute "s|https://files.pythonhosted.org/|/pypifiles/|ni"