Password protect folder nginx

Discussion in 'ISPConfig 3 Priority Support' started by DylanPedro, Feb 8, 2018.

  1. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Hi,

    Is it possible to password protect a folder via ISPConfig control panel for a site on an nginx server?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes. see folder protection feature in site module.
     
  3. DylanPedro

    DylanPedro Member HowtoForge Supporter

    Just tried it, didn't realise you have to also setup a user too to see if it works
     
  4. DylanPedro

    DylanPedro Member HowtoForge Supporter

    I've added munin the added the following to the directive and it works:
    Code:
    location /munin {
        alias /var/cache/munin/www;
      }
    When setting up a password for the /munin folder it shows a username and password as expected but when the correct info is entered a ERROR 403 - Forbidden! is shown?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Take a look at the error.log of the website to find out more.
     
  6. DylanPedro

    DylanPedro Member HowtoForge Supporter

    This is the error on the error.log
    Code:
    2018/02/10 14:00:50 [error] 5721#5721: *188 directory index of "/var/www/server1.example.com/web/munin/" is forbidden, client: 86.4.188.88, server: server1.example.com, request: "GET /munin/ HTTP/1.1", host: "server1.example.com"
     
  7. DylanPedro

    DylanPedro Member HowtoForge Supporter

  8. DylanPedro

    DylanPedro Member HowtoForge Supporter

    phpmyadmin is server on the following url on my server:
    https://server1.example.com:8081/phpmyadmin/

    why does adding /phpadmin to the password protected folders not work even after adding a user?
    even adding the path /usr/share/phpmyadmin is not allowed?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Because /phpmyadmin not a directory of the local website. Port 8081 is a separate vhost.
     
  10. DylanPedro

    DylanPedro Member HowtoForge Supporter

    so can it be protected vi the control panel or do I have to manually add the password protection in the apps vhost file?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    If you want to add password protection to the apps vhost, then you'll have to do that yourself.
     

Share This Page