We use nginx servers as reverse proxies to our upstream app servers.
Currently all upstream proxy requests are made using an empty Accept-encoding header so that responses from the upstreams are cached decompressed. However, this is inefficient because when nginx serves content to gzip-capable clients it recompresses on the fly using the gzip module.
How can I make nginx cache two copies of a file, one gzipped and one decompressed? I thought that the gzip_static module would do this, but it seems it will only serve exisiting .gz files. So what's the best way to create these when using nginx as a reverse proxy?