<p>How can I have login page inside my ingress (nginx)? I know I can use basic authentication or OAuth but I want to have a login page just with one user and I don't want it will be like basic authentication. I want it has a specific page.</p>

Ali Rezvani
<p>As per this official <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/custom-template/#custom-nginx-template" rel="nofollow noreferrer">NGINX Ingress Controller</a> document, you can create a custom nginx page for OAuth or basic authentication nginx ingress controller. For this you have to use the <strong>volume</strong> but at the same time if you are using new template then the <strong>configmap</strong> also needs to be updated.</p>
<p>By using a volume you can add your custom template to nginx deployment like this</p>
<pre><code>volumeMounts:
      - mountPath: /etc/nginx/template
        name: nginx-template-volume
        readOnly: true
  volumes:
    - name: nginx-template-volume
      configMap:
        name: nginx-template
        items:
        - key: custom-nginx.tmpl
          path: custom-nginx.tmpl
</code></pre>
<p>For more detailed information on how to use the custom templates refer this document <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/custom-template/#custom-nginx-template" rel="nofollow noreferrer">DOC1</a> <a href="https://kubernetes.github.io/ingress-nginx/examples/auth/basic/" rel="nofollow noreferrer">DOC2</a></p>
<p>Try this <a href="https://www.youtube.com/watch?v=AXZr2OC8Unc" rel="nofollow noreferrer">tutorial</a> for more details (refer to the custom templates section)</p>
