Skip to content

Instantly share code, notes, and snippets.

@meineerde
Created March 13, 2013 10:11
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save meineerde/5150779 to your computer and use it in GitHub Desktop.
Save meineerde/5150779 to your computer and use it in GitHub Desktop.
Check the Accept-Language Header to emulate part of Apache's content negotiation features. This is based on http://stackoverflow.com/questions/3657614/how-to-rewrite-location-in-nginx-depending-on-the-client-browsers-language
map $http_accept_language $lang {
default en;
~de de;
~en en;
}
location /foo/bar/baz/lang.js {
try_files $uri.$lang $uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment