Commit e32b779e by PLN (Algolia)

serve-out: sert 404.html sur les chemins inconnus (error_page façon nginx) — le…

serve-out: sert 404.html sur les chemins inconnus (error_page façon nginx) — le redirect fuzzy des-femmes peut exercer depuis la preview
parent 584bfc4b
...@@ -56,6 +56,13 @@ createServer(async (req, res) => { ...@@ -56,6 +56,13 @@ createServer(async (req, res) => {
return; return;
} }
} }
// nginx: error_page 404 /404.html — le void hydra + les redirects fuzzy.
const nf = await tryFile("/404.html");
if (nf) {
res.writeHead(404, { "content-type": MIME[".html"] });
res.end(nf.buf);
return;
}
res.writeHead(404, { "content-type": "text/plain; charset=utf-8" }); res.writeHead(404, { "content-type": "text/plain; charset=utf-8" });
res.end("404"); res.end("404");
}).listen(PORT, "127.0.0.1", () => { }).listen(PORT, "127.0.0.1", () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment