2

I have a squid server installed, and I'd like it to be hidden when looking into the headers.

First of all, I was getting both squid and the version on the headers:

curl -i ip_address

HTTP/1.0 400 Bad Request
Server: squid/3.1.10
Mime-Version: 1.0
Date: Wed, 04 Feb 2015 18:58:06 GMT
Content-Type: text/html
Content-Length: 3157
X-Squid-Error: ERR_INVALID_URL 0
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from host.example.com
X-Cache-Lookup: NONE from host.example.com:80
Via: 1.0 host.example.com (squid/3.1.10)
Connection: close

I then set the following directive in /etc/squid/squid.conf:

httpd_suppress_version_string on

And now I'm not getting the squid version:

HTTP/1.0 400 Bad Request
Server: squid
Mime-Version: 1.0
Date: Wed, 04 Feb 2015 19:11:06 GMT
Content-Type: text/html
Content-Length: 13
X-Squid-Error: ERR_INVALID_URL 0
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from host.example.com
X-Cache-Lookup: NONE from host.example.com:80
Via: 1.0 host.example.com (squid)
Connection: close

But I'd like to hide squid from the headers.

I get the same results when I try to use the machine as a proxy, f.i. by using:

curl -i -x http://user:password@ip_address:80 http://iplocation.net

I've tried the solutions form this question, but it's not working.

Any suggestions?

Thanks in advance.

  • If squid has trouble retrieving a given URL it returns it's own error page. – Brian Feb 6 '15 at 13:33
  • 2
    Duplicate of serverfault.com/questions/241918/… . – drookie Feb 6 '15 at 13:49
  • It's not working for me. squid -v shows that it's been compiled with --enable-follow-x-forwarded-for. – tapp Feb 6 '15 at 14:14
3

If you have your squid configured with "--enable-http-violations", check reply-header-replace option. Example:

reply_header_replace Server Foo/1.0

2
reply_header_access X-Squid-Error deny all

More info at Squid docs

  • 1
    Code is good, but some reasons for it and a link to docs would make it worth voting for. – chicks Aug 24 '16 at 14:55
  • 1
    @chicks It does not allow to use corresponding header in response. Nice solution Omid! – Maxim May 5 '18 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.