Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7430

Wrong remote IP in access.log when server is behind a reverse proxy

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5
    • Component/s: None
    • Labels:
      None

      Description

      The default logging configuration (sonar.web.accessLogs.pattern=combined) displays the proxy IP instead of the user remote IP. The correct configuration deserves to be documented in sonar.properties:

      # Format of access log. It is ignored if sonar.web.accessLogs.enable=false. Possible values are:
      #    - "common" is the Common Log Format, shortcut to: %h %l %u %user %date "%r" %s %b
      #    - "combined" is another format widely recognized, shortcut to: %h %l %u [%t] "%r" %s %b "%i{Referer}" "%i{User-Agent}"
      #    - else a custom pattern. See http://logback.qos.ch/manual/layouts.html#AccessPatternLayout.
      # If SonarQube is behind a reverse proxy, then the following value allows to display the correct remote IP address:
      #sonar.web.accessLogs.pattern=%i{X-Forwarded-For} %u [%t] "%r" %s %b "%i{Referer}" "%i{User-Agent}"
      # Default value is:
      #sonar.web.accessLogs.pattern=combined
      

        Attachments

          Activity

            People

            Assignee:
            simon.brandhof Simon Brandhof (Inactive)
            Reporter:
            simon.brandhof Simon Brandhof (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: