Skip to content

Instantly share code, notes, and snippets.

@lrvick
Last active August 29, 2015 14:09
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 lrvick/20c8adb547eb2a29b396 to your computer and use it in GitHub Desktop.
Save lrvick/20c8adb547eb2a29b396 to your computer and use it in GitHub Desktop.
Nginx conditions to deny *.appcache files to IOS7 users to avoid their severe bugs.
# If IOS7 sees a *.appcache file it freaks out and disables browser
# history until browser cache is cleared AND it is rebooted.
# Tell IOS7 users asking for a *.appcache file to GTFO with a 412
# "precondition failed" response so they don't hurt themselves.
if ( $http_user_agent ~* '(iPad|iPhone);.*CPU.*OS 7_' ){
set $test IOS7;
}
if ($request_filename ~* ^.+.appcache$) {
set $test "${test}_APPCACHE";
}
if ($test = IOS7_APPCACHE){
return 412;
}
@keegan-lillo
Copy link

+1

@aheckmann
Copy link

😀

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