Skip to content

Instantly share code, notes, and snippets.

@astamicu
Forked from brool/$__config_tiddlyweb_host.tid
Last active January 6, 2018 14:27
Show Gist options
  • Save astamicu/cb280fdd49e9c79fa23539db51331f99 to your computer and use it in GitHub Desktop.
Save astamicu/cb280fdd49e9c79fa23539db51331f99 to your computer and use it in GitHub Desktop.
Setting up Tiddlywiki behind Nginx (c.f. http://www.brool.com/post/setting-up-tiddlywiki-behind-nginx/)
title: $:/config/tiddlyweb/host
$protocol$//$host$/tw/
#create file in root/WIKINAME/tiddlers
#from https://grosinger.net/blog/2017-09-18-running-tiddlywiki/
#create WIKINAME.service in /etc/systemd/system/
[Unit]
Description=TiddlyWiki 5 Launcher
After=network.target
[Service]
ExecStart=/bin/sh -c "node /usr/local/bin/tiddlywiki /location/WIKINAME --server 8080 $:/core/save/all text/plain text/html USER PASS 0.0.0.0"
Type=simple
User=USER
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
#run
sudo systemctl enable WIKINAME.service
sudo systemctl start WIKINAME.service
tiddlywiki WIKINAME --server 8080 $:/core/save/all text/plain text/html username password 127.0.0.1
#add in etc/nginx/sites-available/default
server {
# blah blah
location /tw/ {
proxy_pass http://127.0.0.1:9999/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# blah blah
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment