Log the original IP address when Stash is behind a load balancer
Symptoms
If Stash is behind a load balancer, you may see the load balancer's IP address in the atlassian-stash-access.log
instead of the IP address of the client making the request.
Resolution
- The load balancer should send a header with the IP address of the original request, some load balancers use
x-forwarded-for
- Add a Valve element to your
<Stash installation directory>/conf/server.xml
that is configured for the header that the load balancer is sending
<Engine name="Catalina" defaultHost="localhost">
<Valve className="org.apache.catalina.valves.RemoteIpValve"
internalProxies="127\.0\.0\.1"
remoteIpHeader="x-forwarded-for"
remoteIpProxiesHeader="x-forwarded-by"
protocolHeader="x-forwarded-proto" />
- Read more about the RemoteIpValve here: https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html
Last modified on Feb 26, 2016
Powered by Confluence and Scroll Viewport.