I would like to have my WriteFreely site hosted in a subdirectory of my domain

This might be either a question that has already been asked (but I couldn’t find it with the search), or a question that has less to do with WriteFreely and more with the correct configuration of nginx. But since I’m out of ideas, I decided I might hazard a chance and ask the question here.

I am currently hosting my WriteFreely site on my VPS server, currently available via https://pannelog.nl although it is still more or less empty. But I would like it to be located in a subdirectory, e.g. https://pannelog.nl/blog. All the nginx configuration examples I could find assume that the site is hosted at the top level of the domain. (Likewise with the Apache example that I saw.) When I change the nginx configuration file, and I change all the locations to include the blog/ part, then the site doesn’t work anymore. (Firefox gives an “The page isn’t redirecting properly” error page, while Chrome shows a 404 Page Not Found generated by nginx.)

There must be a way to change the config or something else that allows me to host the site in a subdirectory. Does anybody know it?

Unfortunately WriteFreely was only made to run at the root of any domain or subdomain, instead of on a subdirectory. The application could always be modified to support this, but it would take deeper changes beyond just the configuration file.

If anyone is interested in working on that, I’d happily review and merge a pull request that included it. (Also see this related GitHub issue: #714 WriteFreely only runs on domain root.)