Skip to content

Instantly share code, notes, and snippets.

@ksamuel
Created July 18, 2011 11:45
Show Gist options
  • Save ksamuel/1089276 to your computer and use it in GitHub Desktop.
Save ksamuel/1089276 to your computer and use it in GitHub Desktop.
#
# A virtual host using mix of IP-, name-, and port-based configuration
#
server {
listen 80;
server_name str1.domain.com
# Limit bandwidth for web videos
location ~ web\.(3gp|mp4|flv)$ {
limit_rate_after 500k;
limit_rate 70k;
mp4;
root /data/domain.com;
}
#limit bandwidth for mobile videos
location ~ mobi\.(3gp|mp4|flv)$ {
limit_rate_after 200k;
limit_rate 30k;
mp4;
root /data/domain.com;
}
#serve images
location ~ \.(jpg|jpeg|gif|png)$ {
root /data/domain.com;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment