Several bugfixes in nginx cronjob

3 parts
* fixes bug #533
* fixes bug #748
* fixes bug #986
* fixes bug #1067