Skip to content

Instantly share code, notes, and snippets.

@dragg
Created September 7, 2017 06:39
Show Gist options
  • Save dragg/9369b28a44ed0a2c21d540dda8da8766 to your computer and use it in GitHub Desktop.
Save dragg/9369b28a44ed0a2c21d540dda8da8766 to your computer and use it in GitHub Desktop.
Nginx
server {
...
location / {
auth_basic "Restricted";
auth_basic_user_file "/home/vagrant/Projects/school/.htpasswd";
try_files $uri $uri/ /index.php?$query_string;
}
location /api/ {
auth_basic off;
try_files $uri $uri/ /index.php?$query_string;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment