Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I was trying to log the user-name in the nginx logs. As I am not doing basic http authentication, adding $remote_user in log_format doesn't work. I will need my application to tell Nginx what the current username is. And to do this I need to add a response header. Can someone please tell me how to add extra header using middleware module and finally use it log_format directive?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.