Use temp nginx logs in docs validation

This commit is contained in:
Nick Sweeting 2026-07-25 12:09:47 -07:00
parent c5aff50a06
commit de4579f2af

View File

@ -241,7 +241,10 @@ def validate_non_running(snippet: Snippet, disposition: str) -> None:
with tempfile.TemporaryDirectory(prefix="archivebox-docs-nginx-") as temp:
config = Path(temp) / "nginx.conf"
config.write_text(
f"pid {temp}/nginx.pid;\nevents {{}}\nhttp {{\nserver {{\nlisten 8080;\n{snippet.code}\n}}\n}}\n",
f"pid {temp}/nginx.pid;\n"
f"error_log {temp}/error.log;\n"
f"events {{}}\n"
f"http {{\naccess_log {temp}/access.log;\nserver {{\nlisten 8080;\n{snippet.code}\n}}\n}}\n",
)
result = subprocess.run(
[nginx, "-t", "-c", config, "-p", temp],