Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Nginx
- ## Basic authentication
- https://www.atlantic.net/uncategorized/configuring-basic-http-authentication-with-nginx-on-ubuntu-22-04/
- ```sh
- sh -c "echo -n 'testuser:' >> /etc/nginx/.htpasswd"
- sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"
- apt install apache2-utils
- ```
- ```
- location / {
- try_files $uri $uri/ =404;
- auth_basic "Basic Authentication";
- auth_basic_user_file /etc/nginx/.htpasswd;
- }
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement