Nginx 1 · Reverse proxy and TLS

Password-protect a location

Require a username and password from an htpasswd file.

auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;

Official Nginx 1 documentation

More reverse proxy and tls commands

All reverse proxy and tls commands · Nginx 1 cheatsheet

Was this page helpful?