Content Compression via Rack::Deflater,Rails and Ngnix

12 views
Skip to first unread message

kingston.s

unread,
Jan 22, 2015, 11:06:02 PM1/22/15
to bangal...@googlegroups.com
I have followed this content-compression-with-rack-deflater.

In my ngnix.conf

 

      gzip on;
      gzip_http_version 1.0;
      gzip_proxied any;
      # See http://wiki.nginx.org/NginxHttpGzipModule#gzip_types
      # This gets rid of a warning about repeated text/html
      gzip_types text/plain text/xml text/css
             text/comma-separated-values
             text/javascript application/x-javascript
             application/atom+xml;


I have restarted both servers,But the response is coming like this.

    Ҳ�t��₎�U�O�Z�+�x�j����X����R�-�[ϗ��3Y�J{��阧s5���/������7��ߣs>3�N4�9�u!�.G�ThvMg�.rFj@�

Am using ngnix with openresty,unicorn and rails 3.2,Please see my request and response headers.


 Request Header:

   Accept    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   Accept-Encoding    gzip, deflate
   Accept-Language    en-US,en;q=0.5
   Cache-Control    no-cache
   Connection    keep-alive
   Cookie    locale=en; _Microsite_session=3bpa2ja8gb17
   Host    mylocal-admin
   Pragma    no-cache
   User-Agent    Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0

 Response Header

    Cache-Control    max-age=0, private, must-revalidate
    Connection    keep-alive
    Content-Encoding    gzip
    Content-Type    text/html; charset=utf-8
    Date    Thu, 22 Jan 2015 12:35:12 GMT
    Etag    "3445b84f524a0746633c15"
    Server    nginx
    Status    200 OK
    Transfer-Encoding    chunked
    Vary    Accept-Encoding
    X-Request-Id    7b448590af53df7a6d91c
    X-Runtime    2.599340
    X-UA-Compatible    IE=Edge

Could anyone please help me to solve this issue.

Vishnu Gopal

unread,
Jan 23, 2015, 2:34:09 AM1/23/15
to bangal...@googlegroups.com, bangal...@googlegroups.com
You either use deflater or the nginx compression. It seems like you are doing both. 


Vishnu Gopal

CTO


MobME Wireless Solutions Ltd.

Kochi - Mumbai - Gurgaon - Thiruvananthapuram

An ISO 9001:2008 Certified Company


Ph: +91 9846 819 066



--
You received this message because you are subscribed to the Google Groups "BANGALORE RUG-Ruby Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bangalorerug...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kingston.s

unread,
Jan 23, 2015, 4:15:20 AM1/23/15
to bangal...@googlegroups.com
Thanks for your reply.

I have disabled gzip  in nginx conf file but result is same.


Thanks,
Kingston.s

Vishnu Gopal

unread,
Jan 23, 2015, 4:28:28 AM1/23/15
to bangal...@googlegroups.com, bangal...@googlegroups.com
Try the reverse? Enabling nginx & disabling the rack solution? You can check if it’s gzip encoded like this: http://www.cyberciti.biz/faq/linux-unix-curl-gzip-compression-test/



Vishnu Gopal

CTO


MobME Wireless Solutions Ltd.

Kochi - Mumbai - Gurgaon - Thiruvananthapuram

An ISO 9001:2008 Certified Company


Ph: +91 9846 819 066



On Fri, Jan 23, 2015 at 9:36 AM, kingston.s <jenori...@gmail.com> wrote:

--
Reply all
Reply to author
Forward
0 new messages