Is there any sort of way to force a password login screen when logging into docker through reverse proxy?


Recommended Posts

Apologies for the long title,

So I just setup a brave browser docker container and its exactly what I was looking for... until I realized it had no login screen. To my knowledge there were no containers that were basically virtual browsers that had a password verification upon logging into the container. I planned on reverse proxying it through NGINXProxyManager and Cloudflare so that's why I need it to be password protected to prevent some rando coming in and messing with my browser. Now im kinda getting back into the game so I dont know much about this reverse proxy stuff as I just set it up, so is there anyway to achieve the goal I'm setting out to do?

TL;DR: I want to reverse proxy a web browser container and need it to be password protected to protect my server, any way to do so?

Link to comment

The reverse proxy can be configured to require a login before the docker container URLs can be accessed.

However, this will not be anything fancy like the usual login pages

I'm not using the specific docker container, but nginx is fairly universal so:

 

A sample location I'm using that is password protected.

    location /transmission {
        satisfy any;
        auth_basic "Transmission Remote Web Client";
        auth_basic_user_file /etc/nginx/transmission.passwd;
        proxy_pass http://192.168.95.20:9091;
    }

Which makes the browser pop this during access

image.png.4d2f811ede9870b03614dfa23375287f.png

 

You can create the password file with the following command line (can be run on the Unraid CLI or inside the NGINX container)

echo USER:$(echo PASSWORD | openssl passwd -apr1) >> site.passwd

The command assumes the login USER with the password PASSWORD (replace as needed) and if you repeat the command for a different user and password, both users can be used to login

 

cf https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-nginx-on-ubuntu-14-04

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.