emptygif
Sprache: Deutsch

Alle Sprachen und Frameworks

nginx (empty_gif) nginx

Ein nginx-Snippet für nginx (empty_gif), das Anfragen an /pixel.gif mit dem leeren GIF beantwortet, das einmal beim Start dekodiert wird.

nginx (empty_gif) nginx

Datei
pixel.conf
Ausführen
nginx -s reload
# 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";
    }
}

Wir haben dieses Snippet ausgeführt und die zurückgegebenen Bytes verglichen.

Prüfen

curl -sI http://localhost:8080/pixel.gif

Offizielle Website: nginx (empty_gif)

Mehr in nginx