Fix 404 page
broken: https://lemmy.ml/docs/en/index.htmlasd
working: https://rust-lang.github.io/mdBook/cli/index.htmlasd
This should be pretty straightforward by adding the following to the nginx config, but I cant get it working.
# docs
location /docs {
proxy_pass http://0.0.0.0:8030;
error_page 404 = https://enterprise.lemmy.ml/docs/en/404.html;
}
I also noticed some more problems:
- loading the 404 page doesnt work because javascript files are served with
text/htmlheaders - images are not loading, it tries
/docs/en/main_screen.pngbut its under/docs/en/about/main_screen.png, so maybe we need to move the file - it would be nice if we could get rid of
.htmlin URLs, but i'm not sure if that works with proxy_pass
Maybe it would be better to fix those problems in Lemmy.
You could redirect to this page: https://enterprise.lemmy.ml/404?err=cant_find_docs
And customize with whatever message you like.
I imagine the 404 stuff should be handled whenever they merge that branch.
I think it needs to be fixed on our end. Right now we are just serving static files, so we need to specify which file should be served if the one requested cant be found. And the mdbook 404 page is clearly better in this case.
I think its on mdBooks end... if I go to https://enterprise.lemmy.ml/docs/en/index.html , all the content-type's for css and javascript are correct. They haven't properly worked out their 404 page. I still just suggest redirecting to our 404 as a short term fix until they actually get their multi-lingual support properly working and merged.