Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need apache_note() function with nginx / usertrack for nginx

Tags:

php

nginx

apache

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.

like image 767
Johnny Avatar asked Feb 12 '26 20:02

Johnny


1 Answers

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

like image 102
henningda Avatar answered Feb 15 '26 08:02

henningda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!