Answer the question
In order to leave comments, you need to log in
How to pass username from auth_basic nginx to backend?
Nginx uses the auth_basic module to authorize users.
location ~^/area {
auth_basic "closed site";
auth_basic_user_file htpasswd;
try_files $uri @backend;
}
Answer the question
In order to leave comments, you need to log in
There is a $remote_user variable . Pass just like any other variable.
If the backend is in PHP, then most likely so, let me know if it doesn’t work and indicate what your backend is on
<?php
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question