0
votes

I'm trying to protect DOMAIN.com/admin, the folder admin doesn't exist its just a route

I have a Codeigniter Controller called Admin.php

and the route for it as follows:

routes.php

$route['admin']                         = 'index_admin';

I'm trying to do Basic Auth, with Nginx

    location /admin {
    auth_basic         "Administrator’s Area";
    auth_basic_user_file /etc/nginx/.htpasswd;
    }

The authentication box is working, however I get 404 error after that.

1
did you perform Valet link operation? - Mahnaz Rafia Islam

1 Answers

0
votes

Fixed added this to the location

try_files $uri $uri/ /index.php$is_args$args;