Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nginx是否可以相应地解压缩gzip文件?_Nginx_Gunzip - Fatal编程技术网

Nginx是否可以相应地解压缩gzip文件?

Nginx是否可以相应地解压缩gzip文件?,nginx,gunzip,Nginx,Gunzip,问题: Nginx是否可以相应地解压缩gzip文件 具体是什么? 请求curl 127.0.0.1/file.json.gz应在响应中返回解压缩的json 更多详细信息: 文件存在/path/File.json.gz Nginx配置: Nginx构建包括gunzip模块 响应是gzip编码的: curl-v 127.0.0.1/file.json.gz *正在尝试127.0.0.1。。。 *连接到127.0.0.1(127.0.0.1)端口80(#0) >GET/index.html.gz HT

问题:

Nginx是否可以相应地解压缩gzip文件

具体是什么?

  • 请求
    curl 127.0.0.1/file.json.gz
    应在响应中返回解压缩的json
  • 更多详细信息:

  • 文件存在
    /path/File.json.gz
  • Nginx配置:
  • Nginx构建包括gunzip模块
  • 响应是gzip编码的:
  • curl-v 127.0.0.1/file.json.gz
    *正在尝试127.0.0.1。。。
    *连接到127.0.0.1(127.0.0.1)端口80(#0)
    >GET/index.html.gz HTTP/1.1
    >主持人:127.0.0.1
    >用户代理:curl/7.47.0
    >接受:*/*
    > 
    
    server {
     location / {
            gunzip on;
            root   /path;
        }
    }
    
    
    nginx -V 2>&1 | grep "\-\-with\-http_gunzip_module" => ... --with-http_gunzip_module ...
    
    curl -v 127.0.0.1/file.json.gz
    *   Trying 127.0.0.1...
    * Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
    > GET /index.html.gz HTTP/1.1
    > Host: 127.0.0.1
    > User-Agent: curl/7.47.0
    > Accept: */*
    > 
    < HTTP/1.1 200 OK
    < Server: nginx/1.13.1
    < Date: Wed, 11 Mar 2020 20:41:59 GMT
    < Content-Type: application/octet-stream
    < Content-Length: 392
    < Last-Modified: Tue, 31 Jan 2017 15:01:11 GMT
    < Connection: keep-alive
    < ETag: "5890a6b7-188"
    < Content-Encoding: gzip
    < Accept-Ranges: bytes
    < 
    ���X�N�0
       ��+