Skip to content

Instantly share code, notes, and snippets.

@pdeschen
Created May 20, 2011 20:19
Show Gist options
  • Save pdeschen/983717 to your computer and use it in GitHub Desktop.
Save pdeschen/983717 to your computer and use it in GitHub Desktop.
nginx 403 handling
upstream test {
server localhost:8080;
}
server {
...
error_page 401 =403 /login;
location ~ ^/model/(.*)$ {
auth_basic "Restricted";
auth_basic_user_file conf/htpasswd;
proxy_pass http://test;
}
location = /login {
proxy_pass http://test;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment