D
D
daocrawler2017-04-07 19:14:06
Nginx
daocrawler, 2017-04-07 19:14:06

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

I have a lot of html files in the directory and its subdirectories, they are already in gzip, I only need to send them via https (in gzip). How in nginx to make sure that for the desired directory it appends the Content-Encoding:gzip header?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-04-07
@RidgeA

More or less like this

location /dir1 {
    location /dir1/dir2 {
        gzip on;
        add_header ....
    }
    ....
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question