0

Upon my server, I am running Webalizer on a few of my client's websites (and associated log files of access). Now this process is fine, and the log files are generated correctly and stored.

What I am trying to set up nginx to do, is for a user to access a domain (logging.{hostname of my server}) and to be presented with the usual htpasswd powered login box. The user then enters the username and password that I have given them, and based on which user logs in, I would like them to be redirected to a relevant folder I specify.

I've done a load of research and I can't figure if this is possible and if so, how to achieve it. Setting up individual logins for each folder seems un-necessary.

Thanks in advance!

1 Answer 1

2

You can tail your configuration to $remote_user variable:

location /webalizer {
 alias /path/to/logs/$remote_user/;
 # your auth options here
}

Be carefull with your usernames though. :)

1
  • I just tried this and it works perfectly! Only small issue, you need a trailing forward slash at the end of the alias directive. But so far, so good! Jun 12, 2012 at 17:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .