NGINX Password Protect website

    • OMV 4.x
    • 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?
    • nginx doesn't use .htaccess and .htpasswd. That is an apache feature. I would run your site in docker using an apache image.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      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):


      Source Code

      1. auth_basic "Administrator Login";
      2. 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!

      The post was edited 1 time, last by Blueman2 ().

    • Users Online 1

      1 Guest