skip to Main Content

Code solutions that add Content-Encoding: gzip to Response Headers seem to work locally but not on the Azure slot.

I have SSHed onto the container and the nginx.config gzip setting is commented out! It is set by default for Windows slots, but commented out by MS for Linux ones.

Normally I would just edit the nginx.config – but how do I make the changes persistent over a slot restart? Changes done to the nginx.config via SSH on the slot instance itself are NOT persisted on slot restart

Modifying nginx.conf for Azure App Linux Service suggests it CANNOT be done.

I can’t see how to do that with the Azure Web App setting – there seem no settings on the slot in the Azure UI.

Does anyone know how to do this? Or that it definitely CANNOT be done by any means?

NOTE: This is NOT an nginx config question but an Azure Linux slot specific one!

2

Answers


  1. Chosen as BEST ANSWER

    Gave up on this line of thought and since it was a static website, put it on a CDN, problem solved.


  2. Here is a Nginx server block that enables gzip for you:

    gzip on;
    gzip_disable "msie6";
    
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_min_length 0;
    gzip_types text/plain application/javascript text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search