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.
- Create the
authfile that holds the username and password.
htpasswd -c auth <username>
- 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 -
- Set
nginxOptions.basicAuthon theMgnlIngress.
nginxOptions:
basicAuth:
enabled: true <1>
basicAuthSecret: basic-auth <2>
basicAuthMessage: "Please login" <3>
Name of the Secret from step 2.
Realm message shown in the browser prompt.