Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

leeyoshinari/nginx_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx_agent

It can be only used with MyPlatform, and can't be used alone.

Deploy

  1. Clone Repository

    git clone https://github.com/leeyoshinari/nginx_agent.git
  2. Modify config.conf. Usually don't need to modify, unless you have special requirements. If the path of access.log isn't found automatically, the path need to be set in config.conf manually.

  3. Modify Nginx log format in nginx.conf.
    Custom log format is

    log_format  main   '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent $upstream_response_time "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
    

    Use custom log format

    access_log  logs/access.log  main;
    

    If you want to output other information, please add it to end of log format.

  4. Package. Using pyinstaller to package python code.

  • (1) Enter folder, run:
    pyinstaller -F server.py -p __init__.py
  • (2) Copy config.conf to the dist folder, cmd: cp config.conf dist/
  • (3) Enter dist folder, zip files, cmd: zip nginx_agent.zip server config.conf
  • (4) Upload zip file to MyPlatform
  • (5) Deploy nginx_agent

NOTE: For Linux Server, the executable file packaged on the server of the CentOS system X86 architecture can only run on the server of the CentOS system X86 architecture; servers of other system and architecture need to be repackaged.

About

Collect API flow by nginx access log

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages