how to protect a django web app deployed in elastic beanstalk docker nginx using password

I’ve a django web application hosted in AWS Elastic Beanstalk with Docker and Nginx. I am using supervisor to start nginx and uwsgi. Need to protect it the website using password. I’ve tried using .htaccess.

htpasswd -cb /etc/nginx/.htpasswd admin admin 

and added the nginx config with

  • When docker run, an error occurs. “ValueError: Unable to configure handler 'watchtower': You must specify a region.”
  • PostgreSQL on AWS ECS: psycopg2.OperationalError invalid port number 5432
  • dockerize does not delay the container initialization
  • PermissionError: [Errno 13] Permission denied: '/code/'
  • difference between building a docker from ubuntu base image and python base image?
  • Supervisor on a Digital Ocean docker image
  •  location / {
       auth_basic "Restricted";
       auth_basic_user_file  /etc/nginx/.htpasswd;
       uwsgi_pass unix:/var/sockets/api.sock;
       include    /home/docker/uwsgi_params; 

    It’s working but its asking password repeatedly. Usually htaccess only asks password once in session. But it asks for username and password every time we click one field or button. Is there any way to fix it?

  • Docker hangs forever during pulling image layers
  • pam limits in docker containers aren't working
  • linux clone() returning -1 as child_pid
  • Windows Container on Windows 10 Insider Build and Docker for Windows
  • StartSSL SSL certificate showing up as net::ERR_CERT_AUTHORITY_INVALID in browser
  • Docker and MySQL can't connect
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.