502 Bad Gateway error upon a form submission