Nginx

From Han Wiki
Revision as of 14:57, 17 March 2023 by Mhan (talk | contribs) (iwu)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Jump to navigation Jump to search

Configuring basic authentication in Nginx

  • Last tested on Ubuntu 20.04, nginx v1.18.0 (2023-03-17)
$ apt install apache2-utils
$ htpasswd -c /etc/nginx/conf.d/.htpasswd developer

Once the file has been created, -c is no longer needed.

  ..
  auth_basic "Restricted Access!";
  auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
  ..