I found this post. That is basically what i needed. Now i just need to apply it only on some paths within the webapp.