Created
October 25, 2011 03:11
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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