Pokúšam sa zaznamenať množstvo bajtov prijatých od klienta v Nginxe takto:
log_format postdata "$remote_addr sent $bytes_received bytes";
Pri pokuse o spustenie služby sa však zobrazuje nasledujúca chyba:
nginx: [emerg] unknown "bytes_received" variable
Pokiaľ vidím, táto premenná by mala byť prítomná v Nginx 1.11.4. Bežím 1.13.9:
#:/usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.13.9
Výstup nginx -V:
:~# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.13.9
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --with-http_ssl_module --with-pcre --with-http_realip_module --with-stream --add-module=../nchan
Je tu niečo, čo tu chýba?
Ďakujeme za pomoc!
odpovede:
0 pre odpoveď č. 1PS: Pomocou odpovedí ako komentárov potrebujem uverejniť veľký text
Zdá sa, že ste ho skompilovali zo zdroja a chýba požadovaný modul. Mám na tom rovnaký výstup
konfigurovať argumenty: --with-cc-opt = "- g -O2 -fPIE -fstack-protector-strong -Wformat -Werror = format-security -Wdate-time -D_FORTIFY_SOURCE = 2" --with-ld-opt = "- Wl, -Bsymbolické funkcie -fPIE -pie -Wl, -z, relro -Wl, -z, teraz "--prefix = / usr / share / nginx --conf-path = / etc / nginx / nginx.conf --http -log-path = / var / log / nginx / access.log --error-log-path = / var / log / nginx / error.log --lock-path = / var / lock / nginx.lock --pid -path = / run / nginx.pid --http-client-body-temp-path = / var / lib / nginx / body --http-fastcgi-temp-path = / var / lib / nginx / fastcgi --http -proxy-temp-cesta = / var / lib / nginx / proxy --http-scgi-temp-cesta = / var / lib / nginx / scgi --http-uwsgi-temp-cesta = / var / lib / nginx / uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module - with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_ xslt_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-thread
Takže sa uistite, že máte všetky stream
modulmi a môže to byť aj nejaký iný modul, je nevyhnutnou podmienkou pre fungovanie