I have a couple of servers running on my network and use MiaB’s hidden reverse proxy feature so they are accessible outside of my network. One of these is a Nextcloud instance. It was all running really well on v57 and Ubuntu 18.04. I don’t do an awful lot with it but I do take the odd photo while out and about and they automatically get uploaded to Nextcloud.
When I originally set this up I had to search around to find out how to enable uploads because they always failed. The original answer I found was to edit etc/nginx/conf.d/local.conf and add two lines to the SSL section of the Nextcloud entry:
sendfile on;
client_max_body_size 0;
This was fine until the next day when MiaB did its update checks and reset this file. After searching around some more and looking at some of the MiaB files (and with a bit of trial and error) I managed to find another solution, which was to edit ~/mailinabox/management/web_update.py and add a couple of lines under these entries:
This has all been working really well but, and I’m not sure if this is a change introduced in v61 or whether it was in v60 too and I hadn’t noticed, it’s now back to resetting the file every day and every morning after I change it back I get an email saying:
web updated
I’m trying to work out if the updater has changed or is broken or whether there’s a better way of doing it in MiaB, so I’m hoping someone here may have a solution.
Have you looked at the code around line 210 of management/web_update.py? It may allow what you’re trying to do by including a conf file that you create:
# Add in any user customizations in the includes/ folder.
nginx_conf_custom_include = os.path.join(env["STORAGE_ROOT"], "www", safe_domain_name(domain) + ".conf")
if os.path.exists(nginx_conf_custom_include):
nginx_conf_extra += "\tinclude %s;\n" % (nginx_conf_custom_include)
Thanks for the reply. I think I did vaguely notice it previously when trying to resolve the issue but, as my solution worked on the older version, didn’t give it much of an afterthought. I’m not entirely sure I’d know how to format an extra config file. Is it as simple as just adding something like:
As there doesn’t seem to be a pre-existing includes folder, can I just check where it’s supposed to go? I’m guessing either /etc/nginx/conf.d/includes or /home/user-data/www/includes?
I’m also guessing that the conf file should be named for the subdomain I’m trying to get this working on (nextcloud.domain.name) to use my above example?
Yeah, gray area in terms of naming, support, and documentation. It’s actually the top-level www directory, typically /home/user-data/www
If you set up foo.net you’ll see this directory gets created: /home/user-data/www/foo.net/
Then just add your server-block custom file next to it, i.e.: /home/user-data/www/foo.net.conf
And get the web service to restart.