Browse Source

Adding custom nginx configuration as a preparation for future migration

Configuring nikola to copy the configuration as is to the output
Adding a custom 403 page and configuring nginx to use it
master
Elia el Lazkani 1 week ago
parent
commit
6c7eda59bd
  1. 1
      conf.py
  2. 15
      nginx/blog.conf.template
  3. 15
      pages/forbidden.org

1
conf.py

@ -281,6 +281,7 @@ DATE_FORMAT = 'YYYY-MM-dd'
# Default is:
# FILES_FOLDERS = {'files': ''}
# Which means copy 'files' into 'output'
FILES_FOLDERS = {'nginx/': 'nginx/'}
# One or more folders containing code listings to be processed and published on
# the site. The format is a dictionary of {source: relative destination}.

15
nginx/blog.conf.template

@ -0,0 +1,15 @@
server {
listen ${NGINX_PORT};
error_page 404 /not-found/index.html;
error_page 403 /forbidden/index.html;
location / {
try_files $uri $uri/ =404;
}
location ^~ /nginx/ {
return 404;
}
}

15
pages/forbidden.org

@ -0,0 +1,15 @@
#+BEGIN_COMMENT
.. title: 403 Forbidden
.. slug: forbidden
.. date: 2021-06-05
.. tags:
.. category:
.. description:
.. type: text
#+END_COMMENT
Naughty naughty !
What brought you to a forbidden page ?
Take this =403 Forbiddin= and head over the main site @ {{% doc name="test" %}}index{{% /doc %}}.
Loading…
Cancel
Save