Hi,
Regarding the site name it's simple by using the capturing PCRE syntax in defining the server name:
server {
listen 80;
server_name ~^(?<site>.+)$;
location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip)$ {
root /home/USERNAME/domains/$site/public_html;
}
}
Regarding the USERNAME it's not clear what you want to do.
Andrejs
Edited 1 time(s). Last edit at 08/25/2011 12:27PM by locojohn.