X-Content-Encoding-Over-Network in Response Header but not Content-Encoding

Viewed 6129

I'm trying to compress the code written with Next.js using Gzip deliver with Nginx and NodeJS server.

It seems the config is working when I use curl -H "Content-Encoding: gzip" to verify.
But come to real browser (Chrome, Firefox) I cannot find the Content-Encoding: gzip property in Response Headers.
Instead, X-Content-Encoding-Over-Network: gzip is appeared.

I use Google Lighthouse to test though the site, it blames me to enable compression on text file.

Actually, what does X-Content-Encoding-Over-Network mean?
How can I get the gzip work with this?

Nginx setting:

gzip on;
gzip_disable "msie6";

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.0;

gzip_types
    text/css
    text/plain
    text/javascript
    application/javascript
    application/json
    application/x-javascript
    application/xml
    application/xml+rss
    application/xhtml+xml
    application/x-font-ttf
    application/x-font-opentype
    application/vnd.ms-fontobject
    image/svg+xml
    image/x-icon
    application/rss+xml
    application/atom_xml;

Next.js Setting

// next.config.js
module.exports = {
  compress: true
};
1 Answers

Your configuration is just good. Sometimes, the problem is caused by Antivirus just like mentioned in comment. Try disabling the antivirus or instead search for HTTP Scanning option in your antivirus program.

NOD Internet Security does this. You can disable this option by following,

1) Open NOD Internet Security

2) Click Setup then Advance Setup

3) Search for HTTP

4) Disable HTTP Scanner

Related