Problem with discourse in a subfolder

I’ve followed the official discourse sub domain guide for subfolder and I’m routing subfolder www.example.com/forum to discourse forum forum.example.com through fastly. I also changed the discourse hostname to DISCOURSE_HOSTNAME: 'www.example.com' now www.example.com/forum shows Error 503 Backend unavailable, is there anything need to change in DNS ?