NGINX Password Protect website

  • I have created .htaccess and .htpasswd files and put them in my root web root directory (above the directory of the web site I want to project) but it appears there is something else I need to configure? I also tried putting the files in the web site's directory itself, but still no joy. Can someone coach me on what I would type into the webui of OMV for this Nginx site?

    • Offizieller Beitrag

    nginx doesn't use .htaccess and .htpasswd. That is an apache feature. I would run your site in docker using an apache image.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thanks! Actually, your comment gave me the idea I needed to research ngnix and found the solution. Using the OMV Gui, under Services/Ngnix/Servers, select the web site you want to password protect. Then click Edit, and at the bottom there is a box for "Extra options". In that box add (without the numbers):



    Code
    auth_basic "Administrator Login";
    auth_basic_user_file /srv/dev-disk-by-label-4TB/Public/WebSite/.htpasswd;

    but replace the 'srv/dev..../Public/WebSite/' with whatever your location is for your website folders. Use the normal method of creating the .htpasswd file, and place it in the MAIN directory of your websites (NOT in the website directory itself). Working perfectly for me!

    • Offizieller Beitrag

    I learned something new :)

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!