I wrote a test script which requires a tool not found in the archive. Because the machine being test doesn't have direct access to the Internet I enabled the nginx service(systemctl start nginx) on the region and placed the file my script needs in /var/www/html.
Testing starts and maas-run-remote-scripts is able to download the script tar and start running. However anything maas-run-remote-scripts POST results in a 500 error. /var/log/maas/http/error.log shows
2018/10/05 01:51:16 [crit] 12031#12031: *4756 open() "/var/lib/nginx/body/0000000140" failed (13: Permission denied), client: 10.245.136.26, server: , request: "POST /MAAS/metadata//2012-03-01/ HTTP/1.1", host: "10-245-136-0--21.maas-internal:5248"
Both nginx.service and maas-http.service are trying to use /var/lib/ nginx/body/ at the same time. nginx.service is running as www-data:root while maas-http.service is running as nobody:root which where the permission error is coming from.
We need to ensure that maas-http.service does not use any resources nginix.service uses to make sure they do not overwrite eachother.