Traefik: Traefik compresses gzipped content again, leading to unreadable content in browser.

Created on 29 Apr 2017  路  3Comments  路  Source: traefik/traefik

What version of Traefik are you using?

Version:      v1.2.3
Codename:     morbier
Go version:   go1.7.5
Built:        2017-04-13_07:21:10PM
OS/Arch:      linux/amd64

What is your environment & configuration (arguments, toml...)?

{
 "GraceTimeOut": 10,
 "Debug": false,
 "CheckNewVersion": true,
 "AccessLogsFile": "",
 "TraefikLogsFile": "/var/log/traefik/daemon.log",
 "LogLevel": "INFO",
 "EntryPoints": {
  "http": {
   "Network": "",
   "Address": ":80",
   "TLS": null,
   "Redirect": {
    "EntryPoint": "https",
    "Regex": "",
    "Replacement": ""
   },
   "Auth": null,
   "Compress": false
  },
  "https": {
   "Network": "",
   "Address": ":443",
   "TLS": {
    "MinVersion": "",
    "CipherSuites": null,
    "Certificates": null,
    "ClientCAFiles": null
   },
   "Redirect": null,
   "Auth": null,
   "Compress": true
  }
 },
 "Cluster": null,
 "Constraints": [],
 "ACME": {
  "Email": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "Domains": null,
  "Storage": "/var/lib/traefik/acme.json",
  "StorageFile": "",
  "OnDemand": true,
  "OnHostRule": false,
  "CAServer": "",
  "EntryPoint": "https",
  "DNSProvider": "",
  "DelayDontCheckDNS": 0,
  "ACMELogging": false,
  "TLSConfig": null
 },
 "DefaultEntryPoints": [
  "http",
  "https"
 ],
 "ProvidersThrottleDuration": 2000000000,
 "MaxIdleConnsPerHost": 200,
 "InsecureSkipVerify": false,
 "Retry": null,
 "Docker": null,
 "File": {
  "Watch": true,
  "Filename": "",
  "Constraints": null
 },
 "Web": {
  "Address": ":8081",
  "CertFile": "",
  "KeyFile": "",
  "ReadOnly": true,
  "Statistics": {
   "RecentErrors": 10
  },
  "Metrics": null,
  "Auth": null
 },
 "Marathon": null,
 "Consul": null,
 "ConsulCatalog": null,
 "Etcd": null,
 "Zookeeper": null,
 "Boltdb": null,
 "Kubernetes": null,
 "Mesos": null,
 "Eureka": null,
 "ECS": null,
 "Rancher": null,
 "ConfigFile": "/etc/traefik/traefik.toml"
}

What did you do?

Enabled compress = true on an EntryPoint.

I have two backends, one serving gzipped content (with the correct "Content-Encoding: gzip" header), the other serving uncompressed content. Before enabling compression in Traefik, the content from both backends is proxied as is.

What did you expect to see?

I expect the content to be compressed only if it isn't already compressed (as indicated by the backend).

What did you see instead?

After enabling compression in the entrypoint all content is indeed gzipped, even if it was already compressed by the backend. In other words it is double-compressed. The browser then decompresses it once, outputting the resulting binary data as if it is text, i.e. unreadable.

kinbuconfirmed resolutioduplicate statu5-frozen-due-to-age

Most helpful comment

I opened a PR in NYTimes/gziphandler which I believe would fix this issue.

All 3 comments

I believe this was reported on Slack as well.

I opened a PR in NYTimes/gziphandler which I believe would fix this issue.

I just realized that this is a duplicate of #1060, so closing.

Please follow up any discussions on the original issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saschagrunert picture saschagrunert  路  3Comments

ewah picture ewah  路  3Comments

thomas15v picture thomas15v  路  3Comments

bitsofinfo picture bitsofinfo  路  3Comments

aximo picture aximo  路  3Comments