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

  • Docker-compose with Django: 'ascii' codec can't decode byte 0xcd in position 7: ordinal not in range(128)
  • Issues in using git forked package in Docker-compose
  • Apache docker container - Invalid command 'RewriteEngine'
  • docker-compose error - unable to read file
  • Troubleshooting API timeout from Django+Celery in Docker Container
  • Docker with Angular 4 and Django is compiled successfully but localhost:4200 is not working
  •  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?

  • I can not see my python django server via IP while the localhost is working
  • How to update rails app on production with Docker and Fig with zero downtime?
  • Spring Boot 1.4.1 SSL trustAnchors exception
  • Exact times in “docker ps” and “docker images”
  • Docker push takes a really long time
  • How does .NET Core on Linux determine what port a SQL Server instance listens on?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.