Open Ask AI (⌘/Ctrl+I)

Basic auth

.htaccess, or hypertext access, is a default directory level configuration file that allows you to create some basic security for directories in a web server.

Enable basic auth via htaccess

Set basic auth on the MgnlIngress. Leave ingress.enabled off in values.yml.

Field names are in Map UI fields to manifest.

  1. Create the auth file that holds the username and password.
htpasswd -c auth <username>
  1. Create a Secret from that file in the same namespace as the Ingress.
kubectl -n <namespace> create secret generic basic-auth --from-file=auth --dry-run=client -o yaml | kubectl apply -f -
  1. Set nginxOptions.basicAuth on the MgnlIngress.
nginxOptions:
  basicAuth:
    enabled: true <1>
    basicAuthSecret: basic-auth <2>
    basicAuthMessage: "Please login" <3>

Basic auth.

Name of the Secret from step 2.

Realm message shown in the browser prompt.