nginx HTTPS and GZIP
September 20, 2016 10:32AM
Hi,

We're currently implementing nginx into our stack as a proxy which sits above our web servers. We've come across an issue which i'm struggling to understand fully. We haven't enabled gzip in our nginx.conf but we have enabled compression server wide in IIS.

The issue is that all HTTPS requests for our bundled jquery file are timing out or responsing in about 60+ secs.

If I request the file under HTTP it works fine.

If i remove gzip from the Accept-Encoding request header when using HTTPS the file returns fine, unzipped and about a file size of 326kb.

I've also noticed that when requesting the file under HTTP, the file is zipped to 94kb. As we haven't enabled gzip in our nginx.conf i'm suprised this is happening?

We have other zipped javascript files that are returned over HTTPS successfully but the jquery file is the largest?

Are there any specific settings i need to enable for gzip over HTTPS?

Many thanks,
Mike
Re: nginx HTTPS and GZIP
September 20, 2016 10:44AM
gzip is off by default for nginx.
You stated you have compression on IIS wide (which is doing compression atm)

If you want gzip over SSL you have to enable it. (and disable it for IIS)

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: nginx HTTPS and GZIP
September 20, 2016 11:45AM
Thanks we just tried enabling gzip for javascript files:

gzip on;
gzip_types application/javascript text/javascript;

But the same thing happened.

This is the error we get from nginx:

2016/09/20 15:37:31 [error] 25#25: *874574 upstream prematurely closed connection while reading response header from upstream

Any more ideas?

Thanks,
Mike
Re: nginx HTTPS and GZIP
September 20, 2016 12:27PM
That message has nothing to do with gzip but an issue with your backend(s).

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: nginx HTTPS and GZIP
September 20, 2016 12:45PM
But we only receive this error when we request the jquery file over https?

Requesting other js files over HTTPS work fine and all HTTP requests work successfully too?

I feel like gzip combined with HTTPS is generating problems causing this timeout?
Re: nginx HTTPS and GZIP
September 20, 2016 01:40PM
Maybe IIS is also compressing? or taking too long to do compression.
check the IIS logfiles against nginx timed entries.

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready