@buntha I don’t know why it’s failing. You would need to add debug points throughout the script, so you can see which parts it might succeed on.
Try manually creating the Nginx config on the server.
The only thing similar between those two commands is cd /etc/nginx/sites-available
which was noticed in the other thread: Metabase timeout configuration
There’s thousands of Metabase instances on EBS, so I’m not sure why you’re having problems, but it seems like it’s something specific to your setup.