Skip to content

Instantly share code, notes, and snippets.

@BBB
Created May 30, 2014 13:09
Show Gist options
  • Save BBB/f4df6b382727fc47f2c7 to your computer and use it in GitHub Desktop.
Save BBB/f4df6b382727fc47f2c7 to your computer and use it in GitHub Desktop.
server {
listen 80;
# Make site accessible from http://localhost/
server_name localhost;
if ($http_host ~* ^www\.) {
rewrite ^www\.(.+)\/(.+) $1/$2 permanent;
}
## Logging
access_log /var/log/www-access.log;
error_log /var/log/www-error.log;
location ~* ^\/scripts\/[A-z0-9]+\.([^/]+)\.js$ {
alias /var/www/scripts/$1.js;
add_header Vary Accept-Encoding;
expires max;
}
## Static Proxy
location / {
root /var/www/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment