Full nextcloud installation guide

So, who is annoyed compiling nginx every time a new version is released?

That script is basically what @riegerCLOUD does in his guide. Change paths if you want to build your stuff somewhere else. Also use at your own risk.

cd /opt;
rm -R nginx*;
wget http://nginx.org/keys/nginx_signing.key;
apt-key add nginx_signing.key;
apt update;
apt build-dep nginx -y;
apt source nginx;
mv nginx*/ nginx;
mkdir nginx/debian/modules -p;
cd /opt/nginx/debian/modules;
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz;
tar -zxvf 2.3.tar.gz;
cd /opt/nginx/debian;
firstflag='--with-ld-opt="$(LDFLAGS)"';
secondflag='--with-ld-opt="$(LDFLAGS)" --add-module="$(CURDIR)/debian/modules/ngx_cache_purge-2.3"';
sed -i 's|'"$firstflag"'|'"$secondflag"'|' rules;
cd /opt/nginx;
dpkg-buildpackage -uc -b -j4;
cd /opt;
rm nginx-dbg*;
filename="$(ls *amd64.deb)";
dpkg --install $filename;
apt-mark hold nginx;
service nginx restart;
systemctl enable nginx.service