LE
nginx_agent
It can be only used with MyPlatform, and can't be used alone.
Deploy
-
Clone Repository
git clone https://github.com/leeyoshinari/nginx_agent.git
-
Modify
config.conf. Usually don't need to modify, unless you have special requirements.
If the path ofaccess.logisn't found automatically, the path need to be set inconfig.confmanually. -
Modify Nginx log format in
nginx.conf.
Custom log format islog_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.
-
Package. Using
pyinstallerto package python code.
- (1) Enter folder, run:
pyinstaller -F server.py -p __init__.py
- (2) Copy
config.confto thedistfolder, cmd:cp config.conf dist/ - (3) Enter
distfolder, 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.