phuslu / nginx-ssl-fingerprint

high performance ja3 and http2 fingerprint for nginx.
BSD 2-Clause "Simplified" License
138 stars 23 forks source link

How to deploy it on systemd? #35

Closed Be1zebub closed 1 year ago

Be1zebub commented 1 year ago

ive tried to replace /usr/sbin/nginx with self compiled /home/nginx/objs/nginx in /usr/lib/systemd/system/nginx.service / /etc/systemd/system/nginx.service & got this error:

$:/home/nginx# systemctl daemon-reload
$:/home/nginx# service nginx restart
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
$:/home/nginx# systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2023-04-16 10:45:05 MSK; 8s ago
       Docs: man:nginx(8)
    Process: 1385450 ExecStartPre=/home/nginx/objs/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
        CPU: 84ms

Apr 16 10:45:05 incredible-gmod nginx[1385450]: Direct leak of 1024 byte(s) in 1 object(s) allocated from:
Apr 16 10:45:05 incredible-gmod nginx[1385450]:     #0 0x7f7c1eaa4a3c in __interceptor_posix_memalign ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:226
Apr 16 10:45:05 incredible-gmod nginx[1385450]:     #1 0x55c5d1611556 in ngx_memalign src/os/unix/ngx_alloc.c:57
Apr 16 10:45:05 incredible-gmod nginx[1385450]:     #2 0x55c5d15a5138 in ngx_create_pool src/core/ngx_palloc.c:23
Apr 16 10:45:05 incredible-gmod nginx[1385450]:     #3 0x55c5d159feba in main src/core/nginx.c:253
Apr 16 10:45:05 incredible-gmod nginx[1385450]:     #4 0x7f7c1e78dd09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09)
Apr 16 10:45:05 incredible-gmod nginx[1385450]: SUMMARY: AddressSanitizer: 1024 byte(s) leaked in 1 allocation(s).
Apr 16 10:45:05 incredible-gmod systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Apr 16 10:45:05 incredible-gmod systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 16 10:45:05 incredible-gmod systemd[1]: Failed to start A high performance web server and a reverse proxy server.

whats iam doing wrong?

phuslu commented 1 year ago

Hi @Be1zebub , this project already assumes that users are experienced users of nginx, so it does not provide the nginx integration and maintenance details.

The setup steps in Readme.md is just for testing and debugging, thanks again.