Summary
I used to create a server block in v3 for sites short domains for static files.
server {
server_name example.com www.example.com;
root /var/www/example.com/htdocs;
access_log /var/log/nginx/example.com.access.log rt_cache_redis;
error_log /var/log/nginx/example.com.error.log;
index index.php index.html index.htm;
include common/redis-php7.conf;
include common/wpcommon-php7.conf;
include common/locations-php7.conf;
include /var/www/example.com/conf/nginx/*.conf;
}
server {
server_name eg.com;
root /var/www/example.com/cdn/uploads;
sendfile on;
tcp_nopush on;
# Cache static files
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|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;
}
}
How do I achieve this in v4? I get nginx errors when I add the static domain server block in the sites custom.conf