Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

QS_ClientIpFromHeader not working

Nick
2012-06-25
2013-05-23
  • Nick
    Nick
    2012-06-25

    I am running in Amazon EC2 instances behind the Amazon ELB

    Apache 2.2.14
    mod_qos 10.8

    Linux   xxxxxxxxxxx  #38-Ubuntu SMP Thu Sep 1 18:09:30 UTC 2011 x86_64 GNU/Linux

    I have verified the ELB headers are present by dumping the headers in a php script

    X-Forwarded-For: 120.136.2.101
    X-Forwarded-Port: 80
    X-Forwarded-Proto: http

    The qos.conf contains  

    QS_ClientIpFromHeader X-Forwarded-For

    The apache error log contains the following error

       mod_qos(069): no valid IP header found: header 'X-Forwarded-For' not available, fallback to connection's IP 10.215.19.207
       mod_qos(069): no valid IP header found: header 'X-Forwarded-For' not available, fallback to connection's IP 10.215.19.207

    What am I doing wrong ?
    this should work.
    Any assistance would be greatly appreciated

    Thanks

    Nick

     
  • I have no experience with this feature myself yet. Maybe this happens within the response processing if the Apache server creates an internal redirect?

    I'm going to implement the following changes:
    - add request id (unique_id) to the error message so that you could correlate with your TransferLog/CustomLog messages
    - add a new log id (to distinguish between request/response errors)
    - extend the "search" for the request header (r->pref->headers_in)

     
  • changes has been applied to mod_qos 10.9

     
  • Nick
    Nick
    2012-06-27

    Thanks for the very fast turnaround on this.

    It looks like it was/is working - but the Amazon ELB does not include the X-Forwarded-For header element for heart beats - so the heartbeat pings to the server (alive status) do not contain the element and apache was reporting these as errors making everything very hard to determine what was happening.

    Thanks

    Nick