During the last holidays I found the time to buy a Raspberry Pi (B+), at last. My main use case will be an ownCloud server within my home’s LAN. I will also access to it from outside the LAN thanks to the DDNS service provided by (e.g.) no-ip.
Owncloud by default depends on the apache webserver, but it works fine with the lighter nginx server, which is recommended to not stress too much the Pi. You have to manually install owncloud, though. I followed this guide and it worked fine (even installing php5-curl worked for me, required for the External Storage application). Note that you can actually skip the steps 1c, 1d and the last part of step 9. Owncloud works just fine without messing with GPU memory, CPU overclock and swap.
That guide though, as well as the official owncloud guide, assumes that the owncloud installation will be accessible from the root of your server, e.g. from example.com. What if you want it to be like example.com/owncloud ?
Actually the solution it’s quite easy, even though it’s not so easy to find it on the web. So, the following is a working nginx configuration file for the discussed setup. Basically I’ve just rewrited the location blocks and the rewrite directives from the configuration file suggested by the linked guides.
On Raspbian/Debian this configuration file is /etc/nginx/sites-available/default, but on different systems it may be located somewhere else. Don’t forget to reload (or restart) nginx after you edit the configuration file.