When running the gateway at localhost:8080, but the agent runs on another port, the agent can't reach the gateway.
It seems like the agent checks if the gateway is located at localhost:8080. If so, the agent tries to look from '/' instead of http://localhost:8080, resulting in an infinitive loop calling the /webapp/josso_login/