Todos los lenguajes y frameworks
nginx (empty_gif) nginx
Un fragmento en nginx para nginx (empty_gif) que responde a las peticiones a /pixel.gif con el GIF vacío, decodificado una sola vez al arrancar.
nginx (empty_gif) nginx
# ngx_http_empty_gif_module ships with standard nginx builds. empty_gif always
# serves nginx's own built-in 43-byte transparent 1x1 GIF; its bytes can't be
# changed (to serve your own GIF, use the static-file or njs variants).
server {
listen 8080;
location = /pixel.gif {
empty_gif;
add_header Cache-Control "no-store";
}
}
Ejecutamos este fragmento y comparamos los bytes que devolvió.
Comprobar
curl -sI http://localhost:8080/pixel.gif
Sitio oficial: nginx (empty_gif)