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.
Fixed added this to the location
try_files $uri $uri/ /index.php$is_args$args;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.