I use Minecraft with the Papermc server. Set permissions so dynamap can write:
sudo chown -R papermc:http /usr/share/nginx/html/minecraft/map/