Tengine/Nginx module for tsar

Support read data from Tengine/Nginx by common socket or unix domain socket.

Source file

Get source file (https://github.com/taobao/tsar-mod_nginx)

Quick start

  1. Install tsar.

  2. Generate a new module by using tsardevel.(see tsar wiki)

tsardevel mod_ngx
  1. Replace mod_ngx.c.
make install
  1. start tsar.
tsar --nginx


  1. Default host is and default port is 80. But we can change both (or one of) the host and port:


export NGX_TSAR_PORT=8080
  1. Stub Status module must be included,and add configuration as below:
location = /nginx_status {
stub_status on;
  1. We can also using unix domain socket, if we set NGX_TSAR_HOST to a filesystem path:


export NGX_TSAR_HOST=/tmp/nginx-tsar.sock

nginx server(which includes the location /nginx_status) must also listen to the unix domain socket path

listen unix:/tmp/nginx-tsar.sock;
  1. The uri and server name sent to the nginx server can alse be changed:


export NGX_TSAR_SERVER_NAME=status.taobao.com
export NGX_TSAR_URI=/nginx_status