D
D
Daniel Newman2017-07-06 17:58:58
Nginx
Daniel Newman, 2017-07-06 17:58:58

No more static in nginx, what should I do?

After a hot hand in the form of reinstalling php from 5.3 to 5.6 on the server and yum update on 618 components, static from /public stopped being returned - everything is a 404 error. Everything except php and css, prescribed before, to set the correct content type.
The main problem is that the directive from the configuration has stopped working as before.

location / {
        try_files $uri $uri /index.php$is_args$args;
}

Solved by an ugly rule of the form
location ~ \.(gif|jpg|png|css|js|ttf|woff|html|htm|svg)$ {
        try_files $uri $uri /index.php$is_args$args;
}

How to return to a state in which I do not need to register all the statics?
UPD: With a little doubt, I see that the version of php-fpm has risen. From 5.5.39 to 5.6.31

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