Access to the folder is restricted through .htaccess , however for static files like *.zip this does not work, because they are processed by nginx and do not pay attention to .htaccess . How to restrict access without transferring *.zip files to the Apache ... it looks like ngnix is ​​compiled without ngx_http_auth_basic_module!

    1 answer 1

    Register in the ngnix config the same settings as in .htaccess, naturally preserving the syntax. Here is the converter from .htaccess to ngnix rule:

    .htaccess in ngnix rule

     location РЕГУЛЯКА_ДЛЯ_К_ФАЙЛАМ { auth_basic "Admin Zone"; auth_basic_user_file /var/www/example.com/admin/.htpasswd; } 

    .htpasswd specify the same as in .htaccess

    • Do not frychit converter! Warning: Invalid argument for foreach () in /usr/local/nginx/html/anilcetin.com/convert-apache-htaccess-to-nginx/rew.php on line 520 - in_ukraine
    • I did not check)) In any case, read about the ngnix rule and write the same conditions for nginx ... - Yoharny Babai
    • I have corrected it, this is how it should work ... - Yoharny Babay
    • it was spelled out, the problem is that ngnix is ​​compiled without ngx_http_auth_basic_module! - in_ukraine
    • rebuild nginx is not yet enough brains, errors are crawling ... - in_ukraine