How to add Content-Encoding:gzip in NGINX for a specific directory?

I have many html files in a directory and its subdirectories, they are already in hipe, I need only to give over https (in gzip). As for nginx to make for the directory it was writing the header Content-Encoding:gzip?
June 27th 19 at 15:19
1 answer
June 27th 19 at 15:21
location /dir1 {
 location /dir1/dir2 {
 gzip on;
 add_header ....

Find more questions by tags GzipHTTP headersNginx