Skip to content

Instantly share code, notes, and snippets.

@jaamo
Created November 10, 2016 07:47
Show Gist options
  • Save jaamo/7e0ca58c19fe390a8ff354f874a5b603 to your computer and use it in GitHub Desktop.
Save jaamo/7e0ca58c19fe390a8ff354f874a5b603 to your computer and use it in GitHub Desktop.
Nginx: document root based on client's ip address
# Set the default path
set $root /var/www/html/dist;
# Change the document root path based on user's ip address
if ($remote_addr ~ "^(71\.134\.111\.38)$") {
set $root /var/www/html/dist1;
}
# Set config
root $root;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment