Skip to content

Instantly share code, notes, and snippets.

@poppen
Last active June 4, 2021 08:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poppen/5727733 to your computer and use it in GitHub Desktop.
Save poppen/5727733 to your computer and use it in GitHub Desktop.
nginx.conf for tDiary server
upstream tdiary {
server localhost:19292;
}
server {
root /path/to/tdiary;
index index.html index.htm;
server_name tdiary.example.org;
location / {
rewrite ^/(\d+)\.html$ /?date=$1 last;
rewrite ^/(\d+)p(\d+)\.html$ /?date=$1&p=$2 last;
rewrite ^/(\d+)\.html#p(\d+)$ /?date=$1&p=$2 last;
proxy_pass http://tdiary;
}
#
# Deny access dot files and data directory
#
location ~ (/\..*|/data/.*) {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment