Welcome to Centmin Mod Community
Become a Member

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

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    1:27 PM
    Nginx-1.29.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 Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    1:27 PM
    Nginx-1.29.x
    MariaDB 10.6.x
    Ok i fix it using:

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

    eva2000 Administrator Staff Member

    58,908
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    8:27 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    yes it's location context specific