Skip to content

Instantly share code, notes, and snippets.

@dbowling
Created January 5, 2012 23:14
Show Gist options
  • Save dbowling/1567899 to your computer and use it in GitHub Desktop.
Save dbowling/1567899 to your computer and use it in GitHub Desktop.
Folder authentication with reverse proxy via NGINX
location / {
try_files $uri @proxy;
}
location ~ (/sait/.*|/vpsa/.*) {
auth_basic "Restricted";
auth_basic_user_file passwords/test;
try_files $uri @proxy;
}
location @proxy {
proxy_pass http://lifeproductioncluster;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment