2017-05-02 2 views
0

나는이 순간에 무엇을 가지고 있습니다.httpd-deflate.conf의 존재하지 않는 이미지에서 gzip 인코딩을 제거하는 방법은 무엇입니까?

의 .htaccess에서
SetEnvIfNoCase Request_URI \ 
\\.(?:gif|jpe?g|jpg|png|rar|zip|exe|flv|swf|mov|wma|mp3|mp4|avi|mp?g)$ no-gzip dont-vary 

: 위치 섹션 아파치 - deflate.conf에서

- GZIP 인코딩하지 않고, 필요에 따라 서버에서 실제로 이러한 설정 이미지

Options +FollowSymlinks 

RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{REQUEST_URI} !^/index\.php$ [NC] 

RewriteRule ^(.+)$ /index.php?_route_=$1 [L,QSA] 

처리되고 서버 응답에 "Content-Encoding : gzip"헤더가 없습니다.

하지만 존재하지 않는 이미지는 index.php 파일에서 처리됩니다. http://example.com/nonexistent-path/non-existent-image.jpg 응답 본체 :

Cache-Control: max-age=84148768 

Connection: keep-alive 

Content-Encoding: gzip 

Content-Length: 49860 

Content-Type: image/jpeg - ((I set it in php manually after image generation before output)) 

Date: Mon, 01 May 2017 22:04:48 GMT 

Expires: Tue, 31 Dec 2019 20:44:16 GMT 

Last-Modified: Thu, 17 Nov 2016 14:51:10 GMT 

Server: nginx 

Strict-Transport-Security: max-age=2592000 

Vary: Accept-Encoding 

X-XSS-Protection: 1; mode=block 

x-content-type-options nosniff 

이 존재하지 않는 이미지 .JPG 화상으로서, 문서로 처리 하였다시피

.

서버에서 나는 아파치와 nginx 프록시를 알고있다. 존재하지 않는 이미지에 대한 gzip 인코딩을 제거하고 서버 응답에서 "Content-Encoding : gzip"을 제거하려면 httpd-deflate.conf 또는 다른 장소에 무엇을 붙여야합니까?

감사합니다.

답변

0

출력 전에 사용하여 PHP 스크립트에서

apache_setenv('no-gzip', '1'); 

합니다.

관련 문제