We are going to be running a nginx reverse proxy that will pull data from a backend via the internet.
What we mean by via the internet is the backend machine will not be on a lan with the front facing reverse proxy.
We were thinking it would be nice to grip these requests prior to sending them over the internet.
The way I see it it should work something like this:
Client requests content with a accept-encoding header or gzip.
Reverse proxy sends this to the backend server.
Backend compresses this content since a accept encoding header of gzip was sent.
Request sent all the way up the chain compressed.
This we can all do as its pretty straight forward. The question I have is how will this work if we have gzip compression enabled on the nginx reverse proxy side?
Will nginx try to gzip content that is already gzipped?
Hope this makes sense. Thank you.
I understand the implications of caching already (and this serving) gzipped content. We would modify the cache key to include the accept encoding header, and thus serve (and cache) the properly compressed / uncompressed content according to what the user agent can accept.