coignard / weblog

A stupidly simple plain text-based blog engine. No HTML, CSS, or JS included.

Home Page:https://renecoignard.com/weblog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for /example-note.txt path format

coignard opened this issue · comments

location / {
    try_files $uri $uri/ @rewrite;
}

location = /sitemap.xml {
    try_files $uri /index.php?go=sitemap.xml;
}

location @rewrite {
    rewrite ^/(.+)\.txt/$ $scheme://$host/$1.txt permanent;
    rewrite ^/(.+)\.txt$ /index.php?go=$1 last;
    rewrite ^/([^/]+)$ $scheme://$host/$1/ permanent;
    rewrite ^/(.*)/$ /index.php?go=$1 last;
}