Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please allow adding properties to server.xml that would add the clients' real ip address to jira access logs when running behind a proxy server #305

Closed
jfabales opened this issue Oct 16, 2019 · 1 comment

Comments

@jfabales
Copy link

Hi wonderful team,
This is not an issue but more of a request. When jira is running behind a proxy server, the client ip address reflected in the jira access logs is all coming from the localhost ip. It would be better to have the clients' real ip addresses inside jira access logs specially when you feed the logs into logstash or filebeat.
The configuration needed should be added to the server.xml file, please see example below:

            <Valve 
                className="org.apache.catalina.valves.RemoteIpValve"
                internalProxies="<proxy server ip addresses e.g. 10\.10\.10\.10|127\.0\.0\.1" />
            <Valve className="org.apache.catalina.valves.AccessLogValve" requestAttributesEnabled="true"
                   pattern="%a %{jira.request.id}r %{jira.request.username}r %t &quot;%m %U%q %H&quot; %s %b %D &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; &quot;%{jira.request.assession.id}r&quot;"/>
        </Engine>

The required changes are:

  • The extra valve
  • and the extra attribute: requestAttributesEnabled="true" in the second valve line with the jira log pattern

Hoping this change is considered.
Thanks!

@oranenj
Copy link
Contributor

oranenj commented Apr 19, 2021

Hi,

this use case should already be possible to accomplish slightly differently with the master branch; see the $tomcat_accesslog_enable_xforwarded_for parameter

@oranenj oranenj closed this as completed Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants