Heim  >  Fragen und Antworten  >  Hauptteil

So überprüfen Sie, ob gzip_static von nginx wirksam ist

Ich habe das statische gzip-Modul kompiliert und wie folgt konfiguriert

gzip  on;
gzip_static on;
gzip_http_version 1.0;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;

gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

Dann wird das gz-Paket von js und css ebenfalls im selben Verzeichnis wie die Quelldatei abgelegt, aber ich kann im Protokoll keinen Zugriff auf gz sehen. Gibt es eine Möglichkeit zu bestätigen, dass nginx das gz-Paket verwendet?

PHPzPHPz2712 Tage vor1394

Antworte allen(1)Ich werde antworten

  • 伊谢尔伦

    伊谢尔伦2017-05-16 17:32:02

    curl -I -H "Accept-Encoding: gzip,deflate" /

    HTTP/1.1 200 OK
    Server: nginx/1.2.3
    Date: Mon, 08 Oct 2012 09:14:20 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Vary: Accept-Encoding
    Set-Cookie: sfsess=5072996cb0a46.21449a2b25cb6e546fe695a152ddc5b5; expires=Tue, 09-Oct-2012 09:14:20 GMT; path=/
    Content-Encoding: gzip

    Antwort
    0
  • StornierenAntwort