Changing document root

I have an existing project, where the wordpress files are found under /app/public.

I tried to move them all to a new folder, /app/public/api and the site now returns a 502 error. I have updated the nginx site.conf root parameter to app/public/api

Does anyone know what else I need to do in order to get this to work.