Skip to content

Instantly share code, notes, and snippets.

@tsaavik
Created September 28, 2018 18:36
Show Gist options
  • Save tsaavik/1ca564b98129a2df6c859d046c8bff79 to your computer and use it in GitHub Desktop.
Save tsaavik/1ca564b98129a2df6c859d046c8bff79 to your computer and use it in GitHub Desktop.
frontend stats
bind :8080
use_backend be_stats unless { path /favicon.ico }
errorfile 503 /etc/haproxy/errors/haproxy-favicon.ico
backend be_stats
stats enable
stats uri /
@tsaavik
Copy link
Author

tsaavik commented Sep 28, 2018

Note: You have to embed the http headers into the .ico file, you can do that via the following 2 commands

echo -e "HTTP/1.0 200 OK\r\nContent-Type: image/x-icon\r\n\r\n" > /etc/haproxy/errors/haproxy-favicon.ico
curl http://www.haproxy.org/favicon.ico >> /etc/haproxy/errors/haproxy-favicon.ico

@tsaavik
Copy link
Author

tsaavik commented Oct 2, 2018

some browsers might want more headers, here are some more 😄

HTTP/1.0 200 OK^M
Accept-Ranges: bytes^M
Content-Length: 1406^M
Content-Type: image/x-icon^M
^M     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment