Browse Source

404 handler

master
Niels G. W. Serup 5 years ago
parent
commit
f201d0f9ad
  1. 6
      nginx/base.conf
  2. 2
      scripts/transform-file.py
  3. 3
      site/404.md

6
nginx/base.conf

@ -3,6 +3,12 @@ server_name metanohi.name www.metanohi.name;
root /var/www/metanohi.name/web-serve;
index index.html;
error_page 404 /404.html
location /404 {
internal;
}
location ~ \.html$ {
internal;
}

2
scripts/transform-file.py

@ -97,7 +97,7 @@ def markdown_to_html(input_file, output_dir):
pages.append((dir + '/' + uri,
os.path.normpath(os.path.join(base_dir, path, name))))
builtins = ['/', '/about/', '/about/niels', '/misc/']
builtins = ['/', '/about/', '/about/niels', '/misc/', '/404']
pages = filter(lambda t: t[0] not in builtins, pages)
pages_new = []
for page in pages:

3
site/404.md

@ -0,0 +1,3 @@
# 404
Try the next exit.
Loading…
Cancel
Save