# Gzip does not work if Content-Type contain semicolon?

**URL:** <https://www.ruby-forum.com/t/gzip-does-not-work-if-content-type-contain-semicolon/246353>\
**Category:** NGINX\
**Created:** [October 2, 2013, 5:07pm UTC](https://www.ruby-forum.com/t/gzip-does-not-work-if-content-type-contain-semicolon/246353 "2013-10-02T17:07:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [October 2, 2013, 5:07pm UTC](https://www.ruby-forum.com/t/gzip-does-not-work-if-content-type-contain-semicolon/246353/1 "2013-10-02T17:07:59Z")

</div>

Hi,

I have some serious troubles getting gzip to compress text/html and  
text/plain content.

I’ve put a nginx as revproxy to Jenkins. Jenkins return headers like  
“Content-Type: text/plain;charset=UTF-8” and “Content-Type:  
text/html;charset=UTF-8”. Even with all fancy stuff like enabling gzip  
for 1.0 proto, gzip\_proxied any and so on, no output is compressed.

Tested version 1.5.4.

– Piotr.

---

<div class="post-metadata">

**Author:** ![hibernaculus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@hibernaculus](https://www.ruby-forum.com/u/hibernaculus)\
**Post date:** [October 2, 2013, 5:13pm UTC](https://www.ruby-forum.com/t/gzip-does-not-work-if-content-type-contain-semicolon/246353/2 "2013-10-02T17:13:50Z")

</div>

Hello!

On Wed, Oct 02, 2013 at 05:07:01PM +0200, Piotr K. wrote:

> Hi,
> 
> I have some serious troubles getting gzip to compress text/html and  
> text/plain content.
> 
> I’ve put a nginx as revproxy to Jenkins. Jenkins return headers like  
> “Content-Type: text/plain;charset=UTF-8” and “Content-Type:  
> text/html;charset=UTF-8”. Even with all fancy stuff like enabling  
> gzip for 1.0 proto, gzip\_proxied any and so on, no output is  
> compressed.

Do you have gzip\_types properly set?

> **[Module ngx\_http\_gzip\_module](http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_types)**
>
> The ngx\_http\_gzip\_module module is a filter that compresses responses using the “gzip” method. This often helps to reduce the size of transmitted data by half or even more.

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![hibernaculus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@hibernaculus](https://www.ruby-forum.com/u/hibernaculus)\
**Post date:** [October 2, 2013, 5:57pm UTC](https://www.ruby-forum.com/t/gzip-does-not-work-if-content-type-contain-semicolon/246353/3 "2013-10-02T17:57:43Z")

</div>

Maxim, thanks for your time and willing to help.

False bug report.

After doing some tests I found out that if I check localhost it does  
gzip, but if I go thru full ip/domain it does not - I had $http\_proxy  
variable set and the proxy server was not providing me gzipped content.  
Sorry about the noise.

– Piotr.

---

<div class="post-metadata">

**Author:** ![hibernaculus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@hibernaculus](https://www.ruby-forum.com/u/hibernaculus)\
**Post date:** [October 2, 2013, 5:27pm UTC](https://www.ruby-forum.com/t/gzip-does-not-work-if-content-type-contain-semicolon/246353/4 "2013-10-02T17:27:53Z")

</div>

Hi,

On 10/02/2013 05:13 PM, Maxim D. wrote:

> Do you have gzip\_types properly set?
> 
> [Module ngx\_http\_gzip\_module](http://nginx.org/r/gzip_types)

I believe I do. I tried quite a lot of combinations, also, text/html is  
default on and cannot be removed if I understand it corrently so it  
should work just as-is. I tried adding even full string like  
“text/html;charset=UTF-8” still no luck.

– Piotr.

---

<div class="post-metadata">

**Author:** ![hibernaculus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@hibernaculus](https://www.ruby-forum.com/u/hibernaculus)\
**Post date:** [October 2, 2013, 5:39pm UTC](https://www.ruby-forum.com/t/gzip-does-not-work-if-content-type-contain-semicolon/246353/5 "2013-10-02T17:39:35Z")

</div>

Hello!

On Wed, Oct 02, 2013 at 05:27:15PM +0200, Piotr K. wrote:

> it should work just as-is. I tried adding even full string like  
> “text/html;charset=UTF-8” still no luck.

Could you please show the configuration you use, and  
an example request which shows the response isn’t gzipped?

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**
