The culprit with nginx is usually a location block like:
# Cache static files
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|jpg|jpeg|png|gif|js|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ {
add_header "Access-Control-Allow-Origin" "*";
access_log off;
log_not_found off;
expires max;
}
due to this missing assets are not passed back to php/WordPress
if you add a rule above this one that reads
location ~* (jpe?g|png|gif) {
try_files $uri $uri/ /index.php?q=$uri&$args;
expires max;
log_not_found off;
access_log off;
}
everything will work as expected. I’ll probably add this to the FAQ section, thanks for pointing it out Anthony.
-
This reply was modified 7 years, 11 months ago by alpipego.
-
This reply was modified 7 years, 11 months ago by alpipego.