Skip to content

Instantly share code, notes, and snippets.

@jdorfman
Created August 22, 2013 05:14
Show Gist options
  • Save jdorfman/6303435 to your computer and use it in GitHub Desktop.
Save jdorfman/6303435 to your computer and use it in GitHub Desktop.

Background

You may create rules to limit access to content. For example, the following rule only allows access to .css or .js files (case sensitive) from the ip address 64.3.62.1 and blocks every other ip address.

Rule

Rule

Resulting Nginx Configuration Block

    location ~* \.(?:css|js)$ {
        allow 64.3.62.1;
        deny all;
        ...
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment