Im getting a error 500 when trying to connect to my server

For anyone that lands here, the most likely cause of this is a rogue config file which is corrupting the config build

running

git clean -ifx

will show any files in the repo which may be interfering.