question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No Google Group - help, need to password protect single directory in container

See original GitHub issue

Hello,

I have tried to follow the instructions and done numerous searches elsewhere but I just cannot get a password protected location code block to appear inside a vhost container config.

I don’t want to password protect the whole container, just a single directory running off the web server on the container.

e.g.

location /linux/ {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/htpasswd/linux;
}

I have managed to bind the password file shown above inside the container from the host filesystem but cannot get the VIRTUAL_HOST / docker-gen to generate the required code block!

Hope anyone can help.

Thanks,

Paully

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
plittlefieldcommented, Mar 23, 2021

Great, problem solved and I am closing this issue.

Hope it helps someone else.

Keep up the great work.

1reaction
plittlefieldcommented, Mar 23, 2021

OK, I think I may have solved the ‘bad news’ problem.

I am not sure if this is technically correct but I added an extra proxy_pass line to the extra /etc/nginx/vhost.d/example.com file, like so…

So, from this…

    location /linux/ {
        auth_basic      "Restricted";
        auth_basic_user_file    /etc/nginx/htpasswd/linux;
    }

To this…

    location /linux/ {
        auth_basic      "Restricted";
        auth_basic_user_file    /etc/nginx/htpasswd/linux;
        proxy_pass http://example.com;
    }

…and now the password protection works and it shows me the correct page at the correct location.

Does that look alright to everyone?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage a user's security settings - Google Workspace Admin ...
Open user security settings · Sign in to your Google Admin console. · In the Admin console, go to Menu · In the...
Read more >
Active Directory user account provisioning - Google Cloud
This article shows you how to set up user and group provisioning between Active Directory and your Cloud Identity or Google Workspace account...
Read more >
Box Collaboration Guidelines | Information Security Office
If a business need requires that a sensitive file be shared with users outside of campus, Box allows end users to password-protect public...
Read more >
Google Provisioning - Okta Documentation
Learn the recommended way to provision Google Workspace users to Okta using SAML or AD to provide users with seamless SSO.
Read more >
How to Password Protect Your WordPress Site: Every Method
Learn how to password protect WordPress using four different methods. Password protect your entire site, posts, categories, or parts of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found