# Securing a web app behind a reverse proxy. On successful login, all requests includes tomcat context

**URL:** <https://forum.keycloak.org/t/securing-a-web-app-behind-a-reverse-proxy-on-successful-login-all-requests-includes-tomcat-context/14841>\
**Category:** Securing applications\
**Created:** [April 7, 2022, 10:45am UTC](https://forum.keycloak.org/t/securing-a-web-app-behind-a-reverse-proxy-on-successful-login-all-requests-includes-tomcat-context/14841 "2022-04-07T10:45:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nachoge](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@nachoge](https://forum.keycloak.org/u/nachoge)\
**Post date:** [April 7, 2022, 10:45am UTC](https://forum.keycloak.org/t/securing-a-web-app-behind-a-reverse-proxy-on-successful-login-all-requests-includes-tomcat-context/14841/1 "2022-04-07T10:45:58Z")

</div>

Hi,

I’ve configured keycloak-17/Quarkus and an application (tomcat spring MVC) with KC adapter. Every thing seems to work as expected but… both kc and the app are behind a reverse proxy (apache).

using http not https yet

keycloak runs on 0.0.0.0:8080 and is accesible at: auth.domain.local:80  
the tomcat+app runs on 127.0.0.1:8082/myapp is accessible at: www.domain.local:80

Is secured via KC adapter and spring security for pre-auth. Once the authenticated the redirect url is:  
www.domain.local/myapp/ Seems KC registers www.domain.local/myapp/ despite www.domain.local  
so all requests must be done to www.domain.local/myapp/

Is there a way to configure KC adapter so redirects are to www.domain.local/ and not www.domain.local/myapp/? or the only way is by configure the app at tomcat ROOT context. If this is the solution what happends with severals apps on the same tomcat

Thanks in advance
