emptygif
언어: 한국어

모든 언어 및 프레임워크

nginx (static file) nginx

/pixel.gif 요청에 빈 GIF로 응답하는 nginx (static file)용 nginx 스니펫입니다. GIF는 시작할 때 한 번만 디코딩합니다.

nginx (static file) nginx

파일
pixel.conf
실행
nginx -s reload
# Write the file once:  printf '%b' '\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\xff\x00\x00\x00\x21\xf9\x04\x01\x00\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b' > /var/www/pixel.gif
server {
    listen 8080;

    location = /pixel.gif {
        alias /var/www/pixel.gif;
        types { }
        default_type image/gif;
        add_header Cache-Control "no-store";
    }
}

이 스니펫은 실행해 보고, 반환된 바이트를 비교했습니다.

확인

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

공식 사이트: nginx (static file)

nginx의 다른 예제