Answer the question
In order to leave comments, you need to log in
Why doesn't internal authorization work on nginx laravel?
Lots of text but need help.
I have a website in Laravel. I need to set a password for it, I have nginx.
In the config I wrote the following:
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
Answer the question
In order to leave comments, you need to log in
It doesn't work because nginx and the web application use the same http header to pass authorization data. There is no universal solution.
Alternatively, if the application is already closed by its authorization, then basic can not be done. Or you can change the authorization header in the web application. Or try to spread the back and front to different domains, so that one is closed by the BASIC, and the other by its own authorization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question