I'm trying to setup a wildcard static domain. My server hosts several domains, so i'd rather have one config for all of them, without having to manually add each and every one. so far i have this...
server {
server_name static.* www.static.*;
root /var/web/$host/;
access_log off;
error_log off;
location ~* \.(jpg|jpeg|gif|png|bmp|ico|pdf|flv|swf|exe|html|htm|txt|css|js) {
add_header Cache-Control public;
add_header Cache-Control must-revalidate;
expires 7d;
}
location / {
deny all;
}
}
all files are stored in /var/web/example.com/ in that format, including subdomains /var/web/subdomain.example.com/
This domain is for static content (only images/css/js etc) and i want the root to be the same as the normal site, just it only allows the static files (hence why php fpm isnt in here)
There arent any nginx errors, but i get 404's, i have a feeling it's to do with root /var/web/$host/; Any ideas?