M
M
MrDoSSSS2017-07-13 16:00:51
Django
MrDoSSSS, 2017-07-13 16:00:51

How to correctly set the expiration of static files in nginx?

Good afternoon! I specify the expiration date of the statics in the nginx settings and it stops loading at all. Perhaps something is not correctly specified in the Django settings, but without specifying the cache expiration time, everything works fine. What to do?
In the config I write:

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires 1w;
    log_not_found off;
}

How to correctly specify the config?
PS: Since I'm using django channels, I'm using Daphne and Redis

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question