nginx-udplog-module
nginx-udplog-module copied to clipboard
Impossible to log to a distant server.
Hi there,
I am trying to use the current main ngx_udplogger (main branch) under freebsd... but it doesn't seems to works.
I use this kind of configuration :
--//-- user nobody; worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
error_log logs/error.log debug;
pid logs/nginx.pid;
events { use kqueue; worker_connections 4096; }
http {
Hashing virtual hosts
server_names_hash_max_size 1024; server_names_hash_bucket_size 128;
MIME Types
include mime.types; default_type application/octet-stream;
Log formats
log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
keepalive_timeout 55; sendfile on; tcp_nopush on; tcp_nodelay on;
UDP Log
access_udplog on; udplog_tag main;
Main Server
server { udplog_tag default; #access_udplog off; access_log off; listen *:8080; listen [::]:8080; server_name _; server_name_in_redirect off; location / { index index.html; root /http/default; } }
Virtual Servers
server { listen *:8080; listen [::]:8080; server_name fqdn.com www.fqdn.com;
access_udplog 172.31.x.x:514 main bare; #udplog_priority local7.info; udplog_tag fqdn.com; access_log off;
index index.php index.html index.htm; location / { root /http/fqdn.com; }
#error_page 500 502 503 504 /50x.html; location = /50x.html { root /hosting/http/default; }
serve static files directly
location ~* .(jpg|jpeg|gif|css|png|js|ico|html)$ { #access_log off; expires max; }
pass the PHP scripts to php-fpm server listening on 127.0.0.1:9000
location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /http/fqdn.com$fastcgi_script_name; include fastcgi_params; }
location ~ /.ht { deny all; } }
} --//--
I have tried some tricks to make this but when I try to see if www.fdqn.com can log into udplog I don't have any chance to make it logging.
When diving into the code, I see that ulcf->off is always true (eg = 1).
Where if the trick to make it working.... ?
Thanks
The configuration looks correct. Is there a debug log?
Hi :) Ok so I'm not dumb... That's good...
Here is debug log (I have added some debug stuff into your module to see that)...
http://oav.net/tmp/debug-ngx.txt
Please don't hesitate to reach me to get some informations.
Kind regards
Try moving access_udplog 172.31.x.x:514 main bare; to the http { section level.
Hi,
Unfortunatly, this didn't change anything.
BTW I use nginx 1.0.10 on freebsd.
Any ideas ?
Kind regards, Xavier
Ok. Seems that branch 1.0.0c fix this problem. Main branch doesn't work as it should. Maybe you should have a look into difference in the code to check what happened.
Kind regards, Xavier
What you need to do is to move the access_updlog line inside the location block. The merge config code for this module does't really works...because of which the configuration never really reaches the location level.
Same here, iamrohit is right, only the directives inside location blocks are followed. Throws signal 11 when used in more than one block, as mentioned in #4.
The module is pretty much useless in this state... :(