Discover Centmin Mod 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 Well-Known Member

    2,725
    243
    63
    May 31, 2014
    Ratings:
    +434
    Local Time:
    4:22 PM
    Nginx-1.13.x
    MariaDB 10.1.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 Well-Known Member

    2,725
    243
    63
    May 31, 2014
    Ratings:
    +434
    Local Time:
    4:22 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Ok i fix it using:

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

    eva2000 Administrator Staff Member

    30,181
    6,786
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,139
    Local Time:
    11:22 PM
    Nginx 1.13.x
    MariaDB 5.5
    yes it's location context specific