1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Securing admin.php with a password - nginx

How to secure admin.php with a password with nginx web server

  1. Robust

    Robust Well-Known Member

    Robust submitted a new resource:

    Securing admin.php with a password - nginx - How to secure admin.php with a password with nginx web server

    Read more about this resource...
     
    Mirovinger likes this.
  2. maxicep

    maxicep Active Member

    location = /admin.php {
    auth_basic "Administrator Login";
    auth_basic_user_file /etc/nginx/passwords/admin;
    # Your PHP block stuff goes here
    }

    What mean this ?
    I tried your code but when i call the admin.php it asks auth its okay and i enter the right infos but browser starting download the admin.php file.
     
  3. Robust

    Robust Well-Known Member

    You're not correctly using the PHP stuff. Where it says # Your PHP block stuff goes here you need to copy and paste what's in your php block.
     
  4. mailshuxin

    mailshuxin Member

    if i add php block,the nginx error:
    nginx: [emerg] location "\.php$" cannot be inside the exact location "/admin.php

    so i changed to :
    location ~* ^/admin\.php {
    ....
    }
    now it work fine
     
  5. Robust

    Robust Well-Known Member

    What's your full server block?
     

Share This Page