Skip to content

mod_crowdsec in Apache/2.4.62 (Debian) + Varnish 7.6.1 results in "no HTTP 0.9 request (with no host line) on incoming request" warning #10

@theSCHAPPY

Description

@theSCHAPPY

Setup: 1. Apache ([public_ip]:443 --> 2. Varnish [::1]:6081 --> 3. Apache ([::1]:80)

  1. I am running Apache2.4 as HTTPS terminator.
  2. Apache connects to a local varnish cache via mod_proxy.
  3. The varnish cache queries the local backend if needed.

I have to enable "ProxyPreserveHost On" on the HTTPS terminator as many backend services need to inspect the original hostname.

  RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  ProxyPreserveHost On
  ProxyPass                   / http://[::1]:6081/ upgrade=websocket
  ProxyPassReverse     / http://[::1]:6081/

When enabling mod_crowdsec, the apache error_log gets filled with the following warning for any request. Although setting Crowdsec off on the HTTPS terminator removes the warnings, but also disabling the filtering option on the terminator at all, which is no adequate option.

[Thu Feb 27 12:19:12.030270 2025] [proxy:warn] [pid 1306891:tid 1307043] [client <REDACTED>:62510] AH01092: no HTTP 0.9 request (with no host line) on incoming request and preserve host set forcing hostname to be <HOSTNAME> for <URI>

Appears that the received HTTP Host header is properly forwarded to the backend.

Many thanks for your support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions