Log the original IP address when Stash is behind a load balancer

'How Do I...' and 'How to...' Guide to Stash

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

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" /> 
Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.