Create a gist now

Instantly share code, notes, and snippets.

@poppen /nginx.conf
Last active Dec 18, 2015

What would you like to do?
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