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:
nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;"
nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-Host $http_host;"
nginx_conf_extra += "\n\t\tproxy_set_header X-Forwarded-Proto $scheme;"
nginx_conf_extra += "\n\t\tproxy_set_header X-Real-IP $remote_addr;"
nginx_conf_extra += "\n\t}\n"
The two lines I added were:
nginx_conf_extra += "\n\tsendfile on;"
nginx_conf_extra += "\n\tclient_max_body_size 0;\n"
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.