Changes of Revision 6
[-] | Changed | nginx.spec |
x 1
2 Source9: Nginx-limit-traffic-rate-module.tar.gz 3 Source10: %{rtmp}.tar.bz2 4 Source11: nginx_upstream_check_module-master.tar.gz 5 +Source12: nginx-statsd.tar.gz 6 +Source13: nginx-munin.tar.gz 7 Source100: index.html 8 Source101: poweredby.png 9 Source102: nginx-logo.png 10
11 %{__tar} zxvf %{SOURCE9} 12 %{__tar} jxvf %{SOURCE10} 13 %{__tar} zxvf %{SOURCE11} 14 +%{__tar} zxvf %{SOURCE12} 15 +%{__tar} zxvf %{SOURCE13} 16 17 %build 18 export DESTDIR=%{buildroot} 19
20 --with-cc-opt="%{optflags} $(pcre-config --cflags)" \ 21 --add-module=%{_builddir}/nginx-%{version}/nginx-upstream-fair \ 22 --add-module=%{_builddir}/nginx-%{version}/nginx_upstream_check_module-master \ 23 + --add-module=%{_builddir}/nginx-%{version}/nginx-statsd \ 24 %if 0%{with_rtmp_ext} 25 --add-module=%{_builddir}/nginx-%{version}/%{rtmp} \ 26 %endif 27 - --add-module=%{_builddir}/nginx-%{version}/Nginx-limit-traffic-rate-module 28 -%if 0%{?fedora_version} > 10 29 + --add-module=%{_builddir}/nginx-%{version}/Nginx-limit-traffic-rate-module \ 30 --with-file-aio 31 -%endif 32 33 make %{?_smp_mflags} 34 35 mv nginx-upstream-fair/README nginx-upstream-fair/README.nginx-upstream-fair 36 37 + 38 + 39 %install 40 rm -rf %{buildroot} 41 make install DESTDIR=%{buildroot} INSTALLDIRS=vendor 42
43 %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} 44 %{__install} -p -D -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/%{name} 45 %{__install} -p -d -m 0755 %{buildroot}%{nginx_confdir}/conf.d 46 +%{__install} -p -d -m 0755 %{SOURCE13} %{buildroot}%{nginx_confdir} 47 %{__install} -p -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE6} %{buildroot}%{nginx_confdir}/conf.d 48 %{__install} -p -d -m 0755 %{buildroot}%{nginx_home_tmp} 49 %{__install} -p -d -m 0755 %{buildroot}%{nginx_logdir} 50
51 %doc LICENSE CHANGES README nginx-upstream-fair/README.nginx-upstream-fair 52 %{nginx_datadir}/ 53 %{_sbindir}/%{name} 54 -# %{_mandir}/man3/%{name}.3pm.gz 55 %{_initrddir}/%{name} 56 %dir %{nginx_confdir} 57 %dir %{nginx_confdir}/conf.d 58
59 60 61 %changelog 62 +* Fri Apr 26 2014 Juergen Gotteswinter <jgqinternetx.com> - 1.6.0-2 63 +- added nginx-statsd module 64 + 65 * Fri Apr 26 2014 Juergen Gotteswinter <jgqinternetx.com> - 1.6.0-1 66 - pushed to new stable branch 1.6 67 68 |
||
[+] | Added | nginx-statsd.conf-sample ^ |
@@ -0,0 +1,39 @@ +http { + + # Set the server that you want to send stats to. + statsd_server your.statsd.server.com; + + # Randomly sample 10% of requests so that you do not overwhelm your statsd server. + # Defaults to sending all statsd (100%). + statsd_sample_rate 10; # 10% of requests + + + server { + listen 80; + server_name www.your.domain.com; + + # Increment "your_product.requests" by 1 whenever any request hits this server. + statsd_count "your_product.requests" 1; + + location / { + + # Increment the key by 1 when this location is hit. + statsd_count "your_product.pages.index_requests" 1; + + # Increment the key by 1, but only if $request_completion is set to something. + statsd_count "your_product.pages.index_responses" 1 "$request_completion"; + + # Send a timing to "your_product.pages.index_response_time" equal to the value + # returned from the upstream server. If this value evaluates to 0 or empty-string, + # it will not be sent. Thus, there is no need to add a test. + statsd_timing "your_product.pages.index_response_time" "$upstream_response_time"; + + # Increment a key based on the value of a custom header. Only sends the value if + # the custom header exists in the upstream response. + statsd_count "your_product.custom_$upstream_http_x_some_custom_header" 1 + "$upstream_http_x_some_custom_header"; + + proxy_pass http://some.other.domain.com; + } + } +} \ No newline at end of file | ||
Added | nginx-statsd.tar.gz ^ |