Difference between revisions of "Nginx"

From Wasya Wiki
Jump to: navigation, search
Line 6: Line 6:
 
   sudo htpasswd -c /etc/apache2/.htpasswd user1
 
   sudo htpasswd -c /etc/apache2/.htpasswd user1
 
   sudo htpasswd /etc/apache2/.htpasswd user2
 
   sudo htpasswd /etc/apache2/.htpasswd user2
 +
 
   location /api {
 
   location /api {
 
     auth_basic          "Administrator’s Area";
 
     auth_basic          "Administrator’s Area";
 
     auth_basic_user_file /etc/apache2/.htpasswd;  
 
     auth_basic_user_file /etc/apache2/.htpasswd;  
 
   }
 
   }

Revision as of 23:36, 20 December 2023

basic auth

From: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/

 sudo htpasswd -c /etc/apache2/.htpasswd user1
 sudo htpasswd /etc/apache2/.htpasswd user2
 location /api {
   auth_basic           "Administrator’s Area";
   auth_basic_user_file /etc/apache2/.htpasswd; 
 }