Skip to content

Instantly share code, notes, and snippets.

@jirutka
Created April 14, 2013 00:28
Show Gist options
  • Save jirutka/5380770 to your computer and use it in GitHub Desktop.
Save jirutka/5380770 to your computer and use it in GitHub Desktop.
Nginx optimization for WebDAV access from OS X Finder. This config snippet ensures that nginx will ignore requests for useless dot files generated by the Finder (.DS_Store, ._*, …)
#
# Ignore requests for useless dot files generated by OS X Finder (WebDAV).
#
# This little hack speeds-up a WebDAV access from the Finder significantly and
# also prevents messing storage with these annoying files.
#
location ~ \.(_.*|DS_Store|Spotlight-V100|TemporaryItems|Trashes|hidden)$ {
access_log off;
error_log off;
if ($request_method = PUT) {
return 403;
}
return 404;
}
location ~ \.metadata_never_index$ {
return 200 "Don't index this drive, Finder!";
}
@RaphaelWimmer
Copy link

Thanks, just what I needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment