Last active
June 4, 2021 08:16
-
-
Save poppen/5727733 to your computer and use it in GitHub Desktop.
nginx.conf for tDiary server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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