The issue was that I had a "Page not found URL" configured in the content settings. This setting prevents from hitting the handler settings in web.config. After removing the url, the handler settings are being applied and it works.
Kentico should not block access to web.config if a url does not exist, because it might very well be a handler. It should redirect after it has established that the url provided is not a handler...allowing access to web.config prior to redirection.