I've recently set up Gollum with Nginx running the backend stuff.
The wiki repository is stored in /path/to/root/todos
(it's a to-do wiki). Because of the way Gollum works, however, if it can't find a page on the wiki, it automatically tries to create one (which is great), but rewrites the url as follows:
http://www.domain.com/todos/foobar
(doesn't exist yet and will be created) gets rewritten to http://www.domain.com/create/foobar
. Now, unless I set up a separate entry for each possible uri that Gollum uses in its own directives, we get a 404 error here.
To circumvent this, I added the following to my nginx config:
```
location / {
index index.php;
try_files $uri /$uri /todos/$uri;
}
```
This works, but it will not accept the index. If I go directly to domain.com/index.php
, I can view the index page as intended. However, going directly to the site (domain.com
) instead redirects to the index for the wiki. (domain.com/create/home
). I don't understand this behaviour, as it is only supposed to route to to-dos (which is a proxy_pass
directive to the Gollum port) if the original $uri can't be found, and index.php
exists.
What am I doing wrong here? It seems like such a simple issue, but this doesn't make any sense to me.
Any assistance would be greatly appreciated.