Skip to content

Instantly share code, notes, and snippets.

@perusio
Created June 23, 2011 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perusio/1043907 to your computer and use it in GitHub Desktop.
Save perusio/1043907 to your computer and use it in GitHub Desktop.
How to whitelist file extensions in Nginx
## This should be the first location in yout config.
location ~* \.(?:gif|html|jpe?g|png|ico|js|css|flv|swf|pdf|xml)$ {
(...)
# serve static files
}
# Put all other locations below
location / {
(...) # more stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment