Answer the question
In order to leave comments, you need to log in
Why doesn't include work in nginx config?
I use https://github.com/h5bp/server-configs-nginx
as a basis . I specified it in
the site config. I specified include h5bp/basic.conf;
it in basic.conf. include h5bp/location/cache-busting.conf;
But the files with the address example.com/css/main.1418295892.css are not located.
If you copy the contents of cache-busting.conf directly into the site config, everything starts working.
The following is in the logs:
2014/12/12 16:41:34 [error] 12858#0: *1 open() "/path/../assets/js/common.1418295892.js" failed (2: No such file or directory)
Answer the question
In order to leave comments, you need to log in
1. Check that the config contains no errors:
2. Show all the latest entries from error.log.
3. But in general, the problem seems to be that h5bp/location/expires.conf is included in h5bp/basic.conf, which already has
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question