![Custom Access Log Nginx Custom Access Log Nginx](http://cdn-ak.f.st-hatena.com/images/fotolife/o/opensourcetech/20140807/20140807194852.png)
While the LAMP stack (Linux + Apache + MySQL + PHP) is very popular for powering WordPress, it is also possible to use Nginx. WordPress supports Nginx, and some large WordPress sites, such as WordPress.com, are powered by Nginx.
Client send to server a custom header. Sample, send a deviceid header to server.
In nginx, we capture this header and write to accesslog for debug, monitor, route request. We need to config nginx that:Enable underscores directive in http selection. Underscoresinheaders on;Set header to a variable (if header is customheader, variable is http + customheader proxysetheader deviceid $httpdeviceid;Re-config log format in nginx config logformat main 'deviceid:$httpdeviceid'Send a request with custom header curl -X POST -H 'deviceid:57cfd83ee4b094690a1db5d6' https://localhost.local/api/log/write.