Skip to content

Instantly share code, notes, and snippets.

@kolber
Created October 25, 2011 03:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kolber/1311189 to your computer and use it in GitHub Desktop.
Save kolber/1311189 to your computer and use it in GitHub Desktop.
Simple virtualhost setup that passes static files to nginx and everything else to Apache
http {
server {
server_name ~^(.+)$;
set $domain $1;
root /var/www/dropbox/$domain;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
}
location ~* "\.(jpg|jpeg|gif|css|png|js|ico|ttf|woff|eot|pdf|mov|mp3|aac|txt)$" {
try_files $uri $uri/ /public/$uri /var/www/dropbox/$domain/public/$uri;
access_log off;
add_header Access-Control-Allow-Origin *;
expires 30d;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment