Learn about Centmin Mod LEMP Stack today
Register Now

Password protecting root doesn't work

Discussion in 'Install & Upgrades or Pre-Install Questions' started by pamamolf, Jun 8, 2016.

  1. pamamolf

    pamamolf Premium Member Premium Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    4:05 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    Hi


    I am using this to password protect a folder:

    Code:
    python /usr/local/nginx/conf/htpasswd.py -c -b /usr/local/nginx/conf/htpasswd4 usernamehere passwordhere
    And this on the domain config file:

    Code:
    location ^~/administrator/ {
    auth_basic "Private";
    auth_basic_user_file /usr/local/nginx/conf/htpasswd4;
    include /usr/local/nginx/conf/php.conf;
    }
    And that's fine but i can't protect root public folder so a popup should come and ask for user and pass to view the site :(
     
    Last edited: Jun 8, 2016
  2. pamamolf

    pamamolf Premium Member Premium Member

    4,101
    428
    83
    May 31, 2014
    Ratings:
    +837
    Local Time:
    4:05 PM
    Nginx-1.26.x
    MariaDB 10.6.x
    Ok i fix it using:

    Code:
    location ~ ^/ {
    :)
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,230
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    11:05 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes it's location context specific