A
A
Alexander2018-02-24 15:53:16
PHP
Alexander, 2018-02-24 15:53:16

Why can't I configure access to the folder with a password (Nginx)?

Guys, I'm already tormented, you need to restrict access to the folder with the script (The mini admin panel on Vuejs also uses PHP)
Server (Nginx, PHP-FPM, SSL)
There is a small js script in /utils
index file index.html
also pulls the file manager in php I set it up
using the standard method described in many manuals

location  ~* ^/utils/index.html {
                auth_basic "Hello, Manager";
                auth_basic_user_file  /etc/nginx/htpasswd;
        }

Gives a php file for download, you need to configure php-fpm, I do this
location  ~* ^/utils/index.html {
                auth_basic "Hello, Manager";
                auth_basic_user_file  /etc/nginx/htpasswd;

                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                include fastcgi_params;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        }

Asks for a password, logs in and gives 403 Access denied.
I tried a million options, I can’t anymore - nolp pliz :)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question