I have nginx server , but need to run apache_note() functionality.
Is there any module , or any patch of nginx which provides this function?
Also need usertrack extension (which is readily available in apache) for nginx or similar alternative of it.If there is no usertrack available with nginx , please suggest some logic which emulates same functionality.
I see there is an accepted answer for this, just adding to it as I guess many people including myself got here from a Google search for apache_note and Nginx.
A main reason for using apache_note is for storing something in the access log. For example a user name when you are not using Basic Authentication.
An easy way to accomplish this with PHP and Nginx is to send it as a header and log that.
PHP: header('username: johndoe');
Add the following to log_format in nginx.conf: $sent_http_username
All headers are available to the log in the form of $sent_http_HEADERNAME
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With