Browse Source

nginx: bump to 1.9.6

In this bump as agreed with Thomas we are dropping out all the nginx 3rd party
addons. In case you would like to see your 3rd party addon included please send
a pull request and make sure it works with newest version.

Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov 9 years ago
parent
commit
2cab2bb7bb

+ 25
- 52
net/nginx/Config.in View File

@@ -8,54 +8,33 @@
8 8
 menu "Configuration"
9 9
         depends on PACKAGE_nginx
10 10
 
11
-config NGINX_STUB_STATUS
12
-	bool
13
-	prompt "Enable stub status module"
14
-	help
15
-		Enable the stub status module which gives some status from the server.
16
-
17
-config NGINX_FLV
18
-	bool
19
-	prompt "Enable FLV module"
20
-	help
21
-		Provides the ability to seek within FLV (Flash) files using time-based offsets.
22
-
23 11
 config NGINX_SSL
24 12
 	bool
25 13
 	prompt "Enable SSL module"
26 14
 	help
27 15
 		Enable HTTPS/SSL support.
16
+	default n
28 17
 
29 18
 config NGINX_DAV
30 19
 	bool
31 20
 	prompt "Enable WebDAV module"
32 21
 	help
33 22
 		Enable the HTTP and WebDAV methods PUT, DELETE, MKCOL, COPY and MOVE.
23
+	default n
34 24
 
35
-config NGINX_LUA
25
+config NGINX_FLV
36 26
 	bool
37
-	prompt "Enable LUA module"
27
+	prompt "Enable FLV module"
38 28
 	help
39
-		Enable support for LUA scripts.
29
+		Provides the ability to seek within FLV (Flash) files using time-based offsets.
30
+	default n
40 31
 
41
-config NGINX_SPNEGO
32
+config NGINX_STUB_STATUS
42 33
 	bool
43
-	prompt "Enable SPNEGO module"
34
+	prompt "Enable stub status module"
44 35
 	help
45
-		Enable support for Kerberos authentication via GSSAPI.
46
-
47
-		See https://github.com/stnoonan/spnego-http-auth-nginx-module
48
-		for specific instructions. Make sure the keytab file is
49
-		readable by user "nobody".
50
-
51
-config NGINX_PCRE
52
-	bool
53
-	prompt "Enable PCRE library usage"
54
-	default y
55
-
56
-config NGINX_HTTP_CACHE
57
-	bool
58
-	prompt "Enable HTTP cache"
36
+		Enable the stub status module which gives some status from the server.
37
+	default n
59 38
 
60 39
 config NGINX_HTTP_CHARSET
61 40
 	bool
@@ -163,40 +142,34 @@ config NGINX_HTTP_BROWSER
163 142
 	prompt "Enable HTTP browser module"
164 143
 	default y
165 144
 
145
+config NGINX_HTTP_UPSTREAM_HASH
146
+	bool
147
+	prompt "Enable HTTP hash module"
148
+	default y
149
+
166 150
 config NGINX_HTTP_UPSTREAM_IP_HASH
167 151
 	bool
168 152
 	prompt "Enable HTTP IP hash module"
169 153
 	default y
170 154
 
171
-config NGINX_NAXSI
155
+config NGINX_HTTP_UPSTREAM_LEAST_CONN
172 156
 	bool
173
-	prompt "Enable NAXSI module"
174
-	select PACKAGE_nginx-naxsi
157
+	prompt "Enable HTTP least conn module"
175 158
 	default y
176
-	help
177
-		Enable support for NAXSI WAF.
178 159
 
179
-config NGINX_PROXYPROTOCOL
160
+config NGINX_HTTP_UPSTREAM_KEEPALIVE
180 161
 	bool
181
-	prompt "Enable HAProxy proxyprotocol"
182
-	select PACKAGE_nginx-proxyprotocol
183
-	select NGINX_SSL
184
-	default n
185
-	help
186
-		Enable support for PROXY PROTOCOL
162
+	prompt "Enable HTTP keepalive module"
163
+	default y
187 164
 
188
-config NGINX_SYSLOG
165
+config NGINX_HTTP_CACHE
189 166
 	bool
190
-	prompt "Enable Syslog module"
191
-	select PACKAGE_nginx-syslog
167
+	prompt "Enable HTTP cache"
192 168
 	default y
193
-	help
194
-		Provides the ability log to a remote destination
195 169
 
196
-config NGINX_HTTP_UPSTREAM_CHECK
170
+config NGINX_PCRE
197 171
 	bool
198
-	select NGINX_SSL
199
-	prompt "Enable HTTP upstream check module"
200
-	default n
172
+	prompt "Enable PCRE library usage"
173
+	default y
201 174
 
202 175
 endmenu

+ 27
- 166
net/nginx/Makefile View File

@@ -8,27 +8,25 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=nginx
11
-PKG_VERSION:=1.4.7
12
-PKG_RELEASE:=4
11
+PKG_VERSION:=1.9.6
12
+PKG_RELEASE:=1
13 13
 
14
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14
+PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://nginx.org/download/
16
-PKG_MD5SUM:=aee151d298dcbfeb88b3f7dd3e7a4d17
16
+PKG_MD5SUM:=f6899825e7a8deadba4948ff84515ad6
17 17
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
18 18
 PKG_LICENSE:=2-clause BSD-like license
19 19
 
20
+PKG_BUILD_DIR:=$(BUILD_DIR)/nginx-$(PKG_VERSION)
21
+
20 22
 PKG_BUILD_PARALLEL:=1
21 23
 PKG_INSTALL:=1
22 24
 
23 25
 PKG_CONFIG_DEPENDS := \
24
-	CONFIG_NGINX_STUB_STATUS \
25
-	CONFIG_NGINX_FLV \
26 26
 	CONFIG_NGINX_SSL \
27 27
 	CONFIG_NGINX_DAV \
28
-	CONFIG_NGINX_LUA \
29
-	CONFIG_NGINX_SPNEGO \
30
-	CONFIG_NGINX_PCRE \
31
-	CONFIG_NGINX_HTTP_CACHE \
28
+	CONFIG_NGINX_FLV \
29
+	CONFIG_NGINX_STUB_STATUS \
32 30
 	CONFIG_NGINX_HTTP_CHARSET \
33 31
 	CONFIG_NGINX_HTTP_GZIP \
34 32
 	CONFIG_NGINX_HTTP_SSI \
@@ -50,7 +48,13 @@ PKG_CONFIG_DEPENDS := \
50 48
 	CONFIG_NGINX_HTTP_LIMIT_REQ \
51 49
 	CONFIG_NGINX_HTTP_EMPTY_GIF \
52 50
 	CONFIG_NGINX_HTTP_BROWSER \
53
-	CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH
51
+	CONFIG_NGINX_HTTP_UPSTREAM_HASH \
52
+	CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH \
53
+	CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN \
54
+	CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE \
55
+	CONFIG_NGINX_HTTP_UPSTREAM_ZONE \
56
+	CONFIG_NGINX_HTTP_CACHE \
57
+	CONFIG_NGINX_PCRE
54 58
 
55 59
 include $(INCLUDE_DIR)/package.mk
56 60
 
@@ -60,7 +64,7 @@ define Package/nginx
60 64
   SUBMENU:=Web Servers/Proxies
61 65
   TITLE:=Nginx web server
62 66
   URL:=http://nginx.org/
63
-  DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl +NGINX_HTTP_GZIP:zlib +libpthread +NGINX_LUA:liblua +NGINX_SPNEGO:krb5-libs
67
+  DEPENDS:=+NGINX_PCRE:libpcre +(NGINX_SSL||NGINX_HTTP_CACHE||NGINX_HTTP_AUTH_BASIC):libopenssl +NGINX_HTTP_GZIP:zlib +libpthread
64 68
   MENU:=1
65 69
 endef
66 70
 
@@ -80,9 +84,6 @@ define Package/nginx/conffiles
80 84
 endef
81 85
 
82 86
 ADDITIONAL_MODULES:=
83
-ifeq ($(CONFIG_NGINX_NAXSI),y)
84
-  ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-naxsi/naxsi_src
85
-endif
86 87
 ifeq ($(CONFIG_IPV6),y)
87 88
   ADDITIONAL_MODULES += --with-ipv6
88 89
 endif
@@ -98,13 +99,6 @@ endif
98 99
 ifeq ($(CONFIG_NGINX_DAV),y)
99 100
   ADDITIONAL_MODULES += --with-http_dav_module
100 101
 endif
101
-ifeq ($(CONFIG_NGINX_LUA),y)
102
-  ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/lua-nginx
103
-endif
104
-ifeq ($(CONFIG_NGINX_SPNEGO),y)
105
-  ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/spnego-http-auth-nginx-module
106
-  TARGET_CFLAGS += -I $(STAGING_DIR)/usr/include/krb5
107
-endif
108 102
 ifneq ($(CONFIG_NGINX_HTTP_CACHE),y)
109 103
   ADDITIONAL_MODULES += --without-http-cache
110 104
 endif
@@ -174,23 +168,21 @@ endif
174 168
 ifneq ($(CONFIG_NGINX_HTTP_BROWSER),y)
175 169
   ADDITIONAL_MODULES += --without-http_browser_module
176 170
 endif
171
+ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_HASH),y)
172
+  ADDITIONAL_MODULES += --without-http_upstream_hash_module
173
+endif
177 174
 ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_IP_HASH),y)
178 175
   ADDITIONAL_MODULES += --without-http_upstream_ip_hash_module
179 176
 endif
180
-ifeq ($(CONFIG_NGINX_PROXYPROTOCOL),y)
181
-  ADDITIONAL_MODULES += --with-proxy-protocol
182
-endif
183
-ifeq ($(CONFIG_NGINX_SYSLOG),y)
184
-  ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-syslog
177
+ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_LEAST_CONN),y)
178
+  ADDITIONAL_MODULES += --without-http_upstream_least_conn_module
185 179
 endif
186
-ifeq ($(CONFIG_NGINX_HTTP_UPSTREAM_CHECK),y)
187
-  ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-upstream-check
180
+ifneq ($(CONFIG_NGINX_HTTP_UPSTREAM_KEEPALIVE),y)
181
+  ADDITIONAL_MODULES += --without-http_upstream_keepalive_module
188 182
 endif
189 183
 
190 184
 define Build/Configure
191
-	# TODO: fix --crossbuild
192
-	(cd $(PKG_BUILD_DIR) ;\
193
-		$(if $(CONFIG_NGINX_LUA),LUA_INC=$(STAGING_DIR)/usr/include LUA_LIB=$(STAGING_DIR)/usr/lib) \
185
+	( cd $(PKG_BUILD_DIR) ; \
194 186
 		./configure \
195 187
 			--crossbuild=Linux::$(ARCH) \
196 188
 			--prefix=/usr \
@@ -205,7 +197,9 @@ define Build/Configure
205 197
 			--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
206 198
 			--with-cc="$(TARGET_CC)" \
207 199
 			--with-cc-opt="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
208
-			--with-ld-opt="$(TARGET_LDFLAGS)" )
200
+			--with-ld-opt="$(TARGET_LDFLAGS)" \
201
+			--without-http_upstream_zone_module \
202
+	)
209 203
 endef
210 204
 
211 205
 define Package/nginx/install
@@ -217,137 +211,4 @@ define Package/nginx/install
217 211
 	$(INSTALL_BIN) ./files/nginx.init $(1)/etc/init.d/nginx
218 212
 endef
219 213
 
220
-define Build/Prepare
221
-	$(call Build/Prepare/Default)
222
-	$(if $(CONFIG_NGINX_LUA),$(call Prepare/lua-nginx))
223
-	$(if $(CONFIG_NGINX_SPNEGO),$(call Prepare/spnego-http-auth-nginx-module))
224
-	$(if $(CONFIG_NGINX_NAXSI),$(call Prepare/nginx-naxsi))
225
-	$(if $(CONFIG_NGINX_SYSLOG),$(call Prepare/nginx-syslog))
226
-	$(if $(CONFIG_NGINX_HTTP_UPSTREAM_CHECK),$(call Prepare/nginx-upstream-check))
227
-endef
228
-
229
-define Download/lua-nginx
230
-	VERSION:=d3ab0edd45bffe1b9a36abdf5bff544de436ccee
231
-	SUBDIR:=lua-nginx
232
-	FILE:=lua-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz
233
-	URL:=https://github.com/chaoslawful/lua-nginx-module.git
234
-	PROTO:=git
235
-endef
236
-
237
-define  Prepare/lua-nginx
238
-	$(eval $(call Download,lua-nginx))
239
-	gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
240
-	$(call PatchDir,$(PKG_BUILD_DIR),./patches-lua-nginx)
241
-endef
242
-
243
-define Download/nginx-upstream-check
244
-	VERSION:=d40b9f956d9d978005bb15616d2f283d4e3d2031
245
-	SUBDIR:=nginx-upstream-check
246
-	FILE:=nginx-upstream-check-$(PKG_VERSION)-$$(VERSION).tar.gz
247
-	URL:=https://github.com/yaoweibin/nginx_upstream_check_module.git
248
-	PROTO:=git
249
-endef
250
-
251
-define  Prepare/nginx-upstream-check
252
-	$(eval $(call Download,nginx-upstream-check))
253
-	gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
254
-	$(call PatchDir,$(PKG_BUILD_DIR),./patches-nginx-upstream-check)
255
-endef
256
-
257
-
258
-define Package/nginx-naxsi
259
-        MENU:=1
260
-        $(call Package/nginx)
261
-        TITLE:=nginx-naxsi
262
-        DEPENDS:=nginx @NGINX_NAXSI
263
-endef
264
-
265
-define Package/nginx-naxsi/description
266
-        NGINX WAF NAXSI
267
-endef
268
-
269
-define Package/nginx-proxyprotocol
270
-        MENU:=1
271
-        $(call Package/nginx)
272
-        TITLE:=nginx 
273
-        DEPENDS:=nginx @NGINX_PROXYPROTOCOL
274
-endef
275
-
276
-define Package/nginx-proxyprotocol/description
277
-        IMPLEMENT Proxy Protocol
278
-endef
279
-
280
-define Package/nginx-syslog
281
-        MENU:=1
282
-        $(call Package/nginx)
283
-        TITLE:=nginx-syslog
284
-        DEPENDS:=nginx @NGINX_SYSLOG
285
-endef
286
-
287
-define Package/nginx-syslog/description
288
-        IMPLEMENT Syslog Protocol
289
-endef
290
-
291
-define Download/nginx-naxsi
292
-	VERSION:=34dcb45fe4fdcb144c5258d83672f8e1e1c8db2e
293
-	SUBDIR:=nginx-naxsi
294
-	FILE:=nginx-naxsi-module-$(PKG_VERSION)-$$(VERSION).tar.gz
295
-	URL:=https://github.com/nbs-system/naxsi.git
296
-	PROTO:=git
297
-endef
298
-
299
-define  Prepare/nginx-naxsi
300
-	$(eval $(call Download,nginx-naxsi))
301
-	gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
302
-endef
303
-
304
-define Package/nginx-naxsi/install
305
-	$(INSTALL_DIR) $(1)/etc/nginx
306
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/nginx-naxsi/naxsi_config/naxsi_core.rules $(1)/etc/nginx
307
-	chmod 0640 $(1)/etc/nginx/naxsi_core.rules
308
-endef
309
-
310
-define Download/nginx-syslog
311
-	VERSION:=7abf48e52552c40a21463e1a8c608e0e575261cd
312
-	SUBDIR:=nginx-syslog
313
-	FILE:=nginx-syslog-module-$(PKG_VERSION)-$$(VERSION).tar.gz
314
-	URL:=https://github.com/splitice/nginx_syslog_patch.git
315
-	PROTO:=git
316
-endef
317
-
318
-define  Prepare/nginx-syslog
319
-	$(eval $(call Download,nginx-syslog))
320
-	gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
321
-endef
322
-
323
-define Package/nginx-proxyprotocol/install
324
-	$(INSTALL_DIR) $(1)/etc/nginx
325
-	$(INSTALL_BIN) ./files/nginx.proxyprotocol.example $(1)/etc/nginx/nginx.conf.proxyprotocol
326
-	chmod 0640 $(1)/etc/nginx/nginx.conf.proxyprotocol
327
-endef
328
-
329
-define Package/nginx-syslog/install
330
-	$(INSTALL_DIR) $(1)/etc/nginx
331
-	$(INSTALL_BIN) ./files/nginx.syslog.example $(1)/etc/nginx/nginx.conf.syslog
332
-	chmod 0640 $(1)/etc/nginx/nginx.conf.syslog
333
-endef
334
-
335
-
336
-define Download/spnego-http-auth-nginx-module
337
-	VERSION:=c85a38c595
338
-	SUBDIR:=spnego-http-auth-nginx-module
339
-	FILE:=spnego-http-auth-nginx-module-$(PKG_VERSION)-$$(VERSION).tar.gz
340
-	URL:=https://github.com/stnoonan/spnego-http-auth-nginx-module
341
-	PROTO:=git
342
-endef
343
-
344
-define  Prepare/spnego-http-auth-nginx-module
345
-	$(eval $(call Download,spnego-http-auth-nginx-module))
346
-	gzip -dc $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
347
-endef
348
-
349 214
 $(eval $(call BuildPackage,nginx))
350
-$(eval $(call BuildPackage,nginx-naxsi))
351
-$(eval $(call BuildPackage,nginx-proxyprotocol))
352
-$(eval $(call BuildPackage,nginx-syslog))
353
-

+ 10
- 17
net/nginx/files/nginx.init View File

@@ -1,24 +1,17 @@
1 1
 #!/bin/sh /etc/rc.common
2
-# Copyright (C) 2009-2012 OpenWrt.org
2
+# Copyright (C) 2015 OpenWrt.org
3 3
 
4 4
 START=50
5
-NGINX_BIN=/usr/sbin/nginx
6 5
 
7
-start() {
8
-	mkdir -p /var/log/nginx
9
-	mkdir -p /var/lib/nginx
10
-	$NGINX_BIN
11
-}
6
+USE_PROCD=1
12 7
 
13
-stop() {
14
-	$NGINX_BIN -s stop
15
-}
8
+start_service() {
9
+	[ -d /var/log/nginx ] || mkdir -p /var/log/nginx
10
+	[ -d /var/lib/nginx ] || mkdir -p /var/lib/nginx
16 11
 
17
-reload() {
18
-	$NGINX_BIN -s reload
12
+	procd_open_instance
13
+	procd_set_param command /usr/sbin/nginx -c /etc/nginx/nginx.conf -g 'daemon off;'
14
+	procd_set_param file /etc/nginx/nginx.conf
15
+	procd_set_param respawn
16
+	procd_close_instance
19 17
 }
20
-
21
-shutdown() {
22
-	$NGINX_BIN -s quit
23
-}
24
-

+ 0
- 40
net/nginx/files/nginx.proxyprotocol.example View File

@@ -1,40 +0,0 @@
1
-worker_processes  1;
2
-pid /tmp/nginx.pid;
3
-daemon off;
4
-master_process off;
5
-error_log stderr debug_core;
6
-
7
-events {
8
- debug_connection <YOUR IPv4>;
9
- debug_connection <YOUR IPV6>;
10
- worker_connections  1024;
11
-}
12
-
13
-http {
14
- default_type  application/octet-stream;
15
- client_body_temp_path /tmp/body 1;
16
-
17
- access_log /tmp/nginx_access.log;
18
-
19
- server {
20
-#  listen       8082 ssl;
21
-# proxy protocol configuration for nginx 1.4.x:
22
-  listen       8082 accept_proxy_protocol=on;
23
-# same with spdy enabled:
24
-#  listen       8082 spdy ssl accept_proxy_protocol=on;
25
-  listen       [::]:8082 ipv6only=on;
26
-  ssl_certificate /your/certificate;
27
-  ssl_certificate_key /your/key;
28
-  server_name  localhost;
29
-# proxy protocol configuration for nginx 1.2.x:
30
-#  accept_proxy_protocol on;
31
- 
32
-  location / {
33
-   proxy_pass        http://127.0.0.1:8084;
34
-   proxy_set_header  X-Real-IP  $remote_addr;
35
-   proxy_connect_timeout 10s;
36
-   proxy_read_timeout 10s;
37
-   send_proxy_protocol on;
38
-  }
39
- }
40
-}

+ 0
- 59
net/nginx/files/nginx.syslog.example View File

@@ -1,59 +0,0 @@
1
-worker_processes  1;
2
-
3
-syslog local6 nginx;
4
-
5
-events {
6
-        worker_connections  1024;
7
-}
8
-
9
-http {
10
-    include       mime.types;
11
-    default_type  application/octet-stream;
12
-
13
-    log_format  main  '$remote_addr - $remote_user [$time_local] $request '
14
-        '"$status" $body_bytes_sent "$http_referer" '
15
-        '"$http_user_agent" "$http_x_forwarded_for"';
16
-
17
-    server {
18
-        listen       80;
19
-        server_name  localhost;
20
-
21
-        #send the log to syslog and file.
22
-        access_log  syslog:notice|logs/host1.access.log main;
23
-
24
-        # pre 1.5.x
25
-        error_log syslog:notice|logs/host1.error.log;
26
-
27
-        location / {
28
-            root   html;
29
-            index  index.html index.htm;
30
-        }
31
-    }
32
-
33
-    server {
34
-        listen       80;
35
-        server_name  www.example.com;
36
-
37
-        access_log  syslog:warn|logs/host2.access.log main;
38
-        error_log syslog:warn|logs/host2.error.log;
39
-
40
-        location / {
41
-            root   html;
42
-            index  index.html index.htm;
43
-        }
44
-    }
45
-
46
-    server {
47
-        listen       80;
48
-        server_name  www.test.com;
49
-
50
-        #send the log just to syslog.
51
-        access_log  syslog:error main;
52
-        error_log syslog:error;
53
-
54
-        location / {
55
-            root   html;
56
-            index  index.html index.htm;
57
-        }
58
-    }
59
-}

+ 0
- 21
net/nginx/patches-lua-nginx/300-ldl.patch View File

@@ -1,21 +0,0 @@
1
---- a/lua-nginx/config
2
-+++ b/lua-nginx/config
3
-@@ -1,5 +1,5 @@
4
- ngx_feature="Lua library"
5
--ngx_feature_libs="-llua -lm"
6
-+ngx_feature_libs="-llua -lm -ldl"
7
- ngx_feature_name=
8
- ngx_feature_run=no
9
- ngx_feature_incs="#include <lauxlib.h>"
10
-@@ -47,9 +47,9 @@ else
11
-         ngx_feature="Lua library in $LUA_LIB and $LUA_INC (specified by the LUA_LIB and LUA_INC env)"
12
-         ngx_feature_path="$LUA_INC"
13
-         if [ $NGX_RPATH = YES ]; then
14
--            ngx_feature_libs="-R$LUA_LIB -L$LUA_LIB -llua -lm"
15
-+            ngx_feature_libs="-R$LUA_LIB -L$LUA_LIB -llua -lm -ldl"
16
-         else
17
--            ngx_feature_libs="-L$LUA_LIB -llua -lm"
18
-+            ngx_feature_libs="-L$LUA_LIB -llua -lm -ldl"
19
-         fi
20
- 
21
-         . auto/feature

+ 0
- 209
net/nginx/patches-nginx-upstream-check/check_1.2.6+.patch View File

@@ -1,209 +0,0 @@
1
-diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c
2
-index 89ccc2b..a552044 100644
3
---- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
4
-+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c
5
-@@ -9,6 +9,10 @@
6
- #include <ngx_core.h>
7
- #include <ngx_http.h>
8
- 
9
-+#if (NGX_UPSTREAM_CHECK_MODULE)
10
-+#include "ngx_http_upstream_check_handler.h"
11
-+#endif
12
-+
13
- 
14
- typedef struct {
15
-     /* the round robin data must be first */
16
-@@ -208,6 +212,12 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
17
- 
18
-             if (!peer->down) {
19
- 
20
-+#if (NGX_UPSTREAM_CHECK_MODULE)
21
-+                ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
22
-+                               "get ip_hash peer, check_index: %ui",
23
-+                               peer->check_index);
24
-+                if (!ngx_http_check_peer_down(peer->check_index)) {
25
-+#endif
26
-                 if (peer->max_fails == 0 || peer->fails < peer->max_fails) {
27
-                     break;
28
-                 }
29
-@@ -216,6 +226,9 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
30
-                     peer->checked = now;
31
-                     break;
32
-                 }
33
-+#if (NGX_UPSTREAM_CHECK_MODULE)
34
-+                }
35
-+#endif
36
-             }
37
- 
38
-             iphp->rrp.tried[n] |= m;
39
-diff --git a/src/http/modules/ngx_http_upstream_least_conn_module.c b/src/http/modules/ngx_http_upstream_least_conn_module.c
40
-index 21156ae..c57393d 100644
41
---- a/src/http/modules/ngx_http_upstream_least_conn_module.c
42
-+++ b/src/http/modules/ngx_http_upstream_least_conn_module.c
43
-@@ -9,6 +9,10 @@
44
- #include <ngx_core.h>
45
- #include <ngx_http.h>
46
- 
47
-+#if (NGX_UPSTREAM_CHECK_MODULE)
48
-+#include "ngx_http_upstream_check_handler.h"
49
-+#endif
50
-+
51
- 
52
- typedef struct {
53
-     ngx_uint_t                        *conns;
54
-@@ -203,6 +207,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
55
-             continue;
56
-         }
57
- 
58
-+#if (NGX_UPSTREAM_CHECK_MODULE)
59
-+        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
60
-+                "get least_conn peer, check_index: %ui",
61
-+                peer->check_index);
62
-+
63
-+        if (ngx_http_check_peer_down(peer->check_index)) {
64
-+            continue;
65
-+        }
66
-+#endif
67
-+
68
-         if (peer->max_fails
69
-             && peer->fails >= peer->max_fails
70
-             && now - peer->checked <= peer->fail_timeout)
71
-@@ -256,6 +270,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
72
-                 continue;
73
-             }
74
- 
75
-+#if (NGX_UPSTREAM_CHECK_MODULE)
76
-+            ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
77
-+                    "get least_conn peer, check_index: %ui",
78
-+                    peer->check_index);
79
-+
80
-+            if (ngx_http_check_peer_down(peer->check_index)) {
81
-+                continue;
82
-+            }
83
-+#endif
84
-+
85
-             if (lcp->conns[i] * best->weight != lcp->conns[p] * peer->weight) {
86
-                 continue;
87
-             }
88
-diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c
89
-index 4b78cff..f077b46 100644
90
---- a/src/http/ngx_http_upstream_round_robin.c
91
-+++ b/src/http/ngx_http_upstream_round_robin.c
92
-@@ -9,6 +9,9 @@
93
- #include <ngx_core.h>
94
- #include <ngx_http.h>
95
- 
96
-+#if (NGX_UPSTREAM_CHECK_MODULE)
97
-+#include "ngx_http_upstream_check_handler.h"
98
-+#endif
99
- 
100
- static ngx_int_t ngx_http_upstream_cmp_servers(const void *one,
101
-     const void *two);
102
-@@ -87,7 +90,17 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
103
-                 peers->peer[n].weight = server[i].weight;
104
-                 peers->peer[n].effective_weight = server[i].weight;
105
-                 peers->peer[n].current_weight = 0;
106
--                n++;
107
-+
108
-+#if (NGX_UPSTREAM_CHECK_MODULE)
109
-+                if (!server[i].down) {
110
-+                    peers->peer[n].check_index =
111
-+                        ngx_http_check_add_peer(cf, us, &server[i].addrs[j]);
112
-+                }
113
-+                else {
114
-+                    peers->peer[n].check_index = (ngx_uint_t) NGX_ERROR;
115
-+                }
116
-+#endif
117
-+               n++;
118
-             }
119
-         }
120
- 
121
-@@ -145,6 +158,17 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
122
-                 backup->peer[n].max_fails = server[i].max_fails;
123
-                 backup->peer[n].fail_timeout = server[i].fail_timeout;
124
-                 backup->peer[n].down = server[i].down;
125
-+
126
-+#if (NGX_UPSTREAM_CHECK_MODULE)
127
-+                if (!server[i].down) {
128
-+                    backup->peer[n].check_index =
129
-+                        ngx_http_check_add_peer(cf, us, &server[i].addrs[j]);
130
-+                }
131
-+                else {
132
-+                    backup->peer[n].check_index = (ngx_uint_t) NGX_ERROR;
133
-+                }
134
-+#endif
135
-+
136
-                 n++;
137
-             }
138
-         }
139
-@@ -206,6 +230,9 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
140
-         peers->peer[i].current_weight = 0;
141
-         peers->peer[i].max_fails = 1;
142
-         peers->peer[i].fail_timeout = 10;
143
-+#if (NGX_UPSTREAM_CHECK_MODULE)
144
-+        peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR;
145
-+#endif
146
-     }
147
- 
148
-     us->peer.data = peers;
149
-@@ -323,6 +350,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
150
-         peers->peer[0].current_weight = 0;
151
-         peers->peer[0].max_fails = 1;
152
-         peers->peer[0].fail_timeout = 10;
153
-+#if (NGX_UPSTREAM_CHECK_MODULE)
154
-+        peers->peer[0].check_index = (ngx_uint_t) NGX_ERROR;
155
-+#endif
156
- 
157
-     } else {
158
- 
159
-@@ -356,6 +386,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
160
-             peers->peer[i].current_weight = 0;
161
-             peers->peer[i].max_fails = 1;
162
-             peers->peer[i].fail_timeout = 10;
163
-+#if (NGX_UPSTREAM_CHECK_MODULE)
164
-+            peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR;
165
-+#endif
166
-         }
167
-     }
168
- 
169
-@@ -434,6 +467,12 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
170
-             goto failed;
171
-         }
172
- 
173
-+#if (NGX_UPSTREAM_CHECK_MODULE)
174
-+        if (ngx_http_check_peer_down(peer->check_index)) {
175
-+            goto failed;
176
-+        }
177
-+#endif
178
-+
179
-     } else {
180
- 
181
-         /* there are several peers */
182
-@@ -531,6 +570,12 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp)
183
-             continue;
184
-         }
185
- 
186
-+#if (NGX_UPSTREAM_CHECK_MODULE)
187
-+        if (ngx_http_check_peer_down(peer->check_index)) {
188
-+            continue;
189
-+        }
190
-+#endif
191
-+
192
-         if (peer->max_fails
193
-             && peer->fails >= peer->max_fails
194
-             && now - peer->checked <= peer->fail_timeout)
195
-diff --git a/src/http/ngx_http_upstream_round_robin.h b/src/http/ngx_http_upstream_round_robin.h
196
-index 3f8cbf8..1613168 100644
197
---- a/src/http/ngx_http_upstream_round_robin.h
198
-+++ b/src/http/ngx_http_upstream_round_robin.h
199
-@@ -30,6 +30,10 @@ typedef struct {
200
-     ngx_uint_t                      max_fails;
201
-     time_t                          fail_timeout;
202
- 
203
-+#if (NGX_UPSTREAM_CHECK_MODULE)
204
-+    ngx_uint_t                      check_index;
205
-+#endif
206
-+
207
-     ngx_uint_t                      down;          /* unsigned  down:1; */
208
- 
209
- #if (NGX_HTTP_SSL)

+ 0
- 35
net/nginx/patches/100-musl-no-sysctl.patch View File

@@ -1,35 +0,0 @@
1
-Index: nginx-1.4.7/src/os/unix/ngx_linux_config.h
2
-===================================================================
3
---- nginx-1.4.7.orig/src/os/unix/ngx_linux_config.h
4
-+++ nginx-1.4.7/src/os/unix/ngx_linux_config.h
5
-@@ -51,7 +51,6 @@
6
- #include <malloc.h>             /* memalign() */
7
- #include <limits.h>             /* IOV_MAX */
8
- #include <sys/ioctl.h>
9
--#include <sys/sysctl.h>
10
- #include <crypt.h>
11
- #include <sys/utsname.h>        /* uname() */
12
-
13
---- nginx-1.2.7/src/os/unix/ngx_user.c
14
-+++ nginx-1.2.7-patched/src/os/unix/ngx_user.c
15
-@@ -31,8 +31,6 @@
16
-     struct crypt_data   cd;
17
- 
18
-     cd.initialized = 0;
19
--    /* work around the glibc bug */
20
--    cd.current_salt[0] = ~salt[0];
21
- 
22
-     value = crypt_r((char *) key, (char *) salt, &cd);
23
-
24
-diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
25
-index 528ee17..73ef359 100644
26
---- a/auto/lib/openssl/conf
27
-+++ b/auto/lib/openssl/conf
28
-@@ -47,7 +47,7 @@ else
29
-         ngx_feature_run=no
30
-         ngx_feature_incs="#include <openssl/ssl.h>"
31
-         ngx_feature_path=
32
--        ngx_feature_libs="-lssl -lcrypto"
33
-+        ngx_feature_libs="-lssl -lcrypto -lz"
34
-         ngx_feature_test="SSL_library_init()"
35
-         . auto/feature

+ 10
- 10
net/nginx/patches/101-feature_test_fix.patch View File

@@ -11,7 +11,7 @@
11 11
      ngx_feature_libs=
12 12
 --- a/auto/cc/conf
13 13
 +++ b/auto/cc/conf
14
-@@ -155,7 +155,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
14
+@@ -178,7 +178,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
15 15
      else
16 16
          ngx_feature="C99 variadic macros"
17 17
          ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
@@ -20,7 +20,7 @@
20 20
          ngx_feature_incs="#include <stdio.h>
21 21
  #define var(dummy, ...)  sprintf(__VA_ARGS__)"
22 22
          ngx_feature_path=
23
-@@ -169,7 +169,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
23
+@@ -192,7 +192,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
24 24
  
25 25
      ngx_feature="gcc variadic macros"
26 26
      ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
@@ -31,7 +31,7 @@
31 31
      ngx_feature_path=
32 32
 --- a/auto/os/linux
33 33
 +++ b/auto/os/linux
34
-@@ -48,7 +48,7 @@ fi
34
+@@ -36,7 +36,7 @@ fi
35 35
  
36 36
  ngx_feature="epoll"
37 37
  ngx_feature_name="NGX_HAVE_EPOLL"
@@ -40,7 +40,7 @@
40 40
  ngx_feature_incs="#include <sys/epoll.h>"
41 41
  ngx_feature_path=
42 42
  ngx_feature_libs=
43
-@@ -73,7 +73,7 @@ fi
43
+@@ -93,7 +93,7 @@ ngx_feature_test="int fd; struct stat sb
44 44
  CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
45 45
  ngx_feature="sendfile()"
46 46
  ngx_feature_name="NGX_HAVE_SENDFILE"
@@ -49,7 +49,7 @@
49 49
  ngx_feature_incs="#include <sys/sendfile.h>
50 50
                    #include <errno.h>"
51 51
  ngx_feature_path=
52
-@@ -94,7 +94,7 @@ fi
52
+@@ -114,7 +114,7 @@ fi
53 53
  CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
54 54
  ngx_feature="sendfile64()"
55 55
  ngx_feature_name="NGX_HAVE_SENDFILE64"
@@ -58,7 +58,7 @@
58 58
  ngx_feature_incs="#include <sys/sendfile.h>
59 59
                    #include <errno.h>"
60 60
  ngx_feature_path=
61
-@@ -112,7 +112,7 @@ ngx_include="sys/prctl.h"; . auto/includ
61
+@@ -132,7 +132,7 @@ ngx_include="sys/prctl.h"; . auto/includ
62 62
  
63 63
  ngx_feature="prctl(PR_SET_DUMPABLE)"
64 64
  ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
@@ -69,7 +69,7 @@
69 69
  ngx_feature_libs=
70 70
 --- a/auto/unix
71 71
 +++ b/auto/unix
72
-@@ -618,7 +618,7 @@ ngx_feature_test="void *p; p = memalign(
72
+@@ -678,7 +678,7 @@ ngx_feature_test="void *p; p = memalign(
73 73
  
74 74
  ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
75 75
  ngx_feature_name="NGX_HAVE_MAP_ANON"
@@ -78,7 +78,7 @@
78 78
  ngx_feature_incs="#include <sys/mman.h>"
79 79
  ngx_feature_path=
80 80
  ngx_feature_libs=
81
-@@ -631,7 +631,7 @@ ngx_feature_test="void *p;
81
+@@ -691,7 +691,7 @@ ngx_feature_test="void *p;
82 82
  
83 83
  ngx_feature='mmap("/dev/zero", MAP_SHARED)'
84 84
  ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
@@ -87,7 +87,7 @@
87 87
  ngx_feature_incs="#include <sys/mman.h>
88 88
                    #include <sys/stat.h>
89 89
                    #include <fcntl.h>"
90
-@@ -646,7 +646,7 @@ ngx_feature_test='void *p; int  fd;
90
+@@ -706,7 +706,7 @@ ngx_feature_test='void *p; int  fd;
91 91
  
92 92
  ngx_feature="System V shared memory"
93 93
  ngx_feature_name="NGX_HAVE_SYSVSHM"
@@ -96,7 +96,7 @@
96 96
  ngx_feature_incs="#include <sys/ipc.h>
97 97
                    #include <sys/shm.h>"
98 98
  ngx_feature_path=
99
-@@ -660,7 +660,7 @@ ngx_feature_test="int  id;
99
+@@ -720,7 +720,7 @@ ngx_feature_test="int  id;
100 100
  
101 101
  ngx_feature="POSIX semaphores"
102 102
  ngx_feature_name="NGX_HAVE_POSIX_SEM"

+ 0
- 33
net/nginx/patches/300-crosscompile_ccflags.patch View File

@@ -1,33 +0,0 @@
1
---- a/auto/endianness
2
-+++ b/auto/endianness
3
-@@ -21,7 +21,7 @@ int main() {
4
- 
5
- END
6
- 
7
--ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
8
-+ngx_test="$CC $NGX_CC_OPT $CC_TEST_FLAGS $CC_AUX_FLAGS \
9
-           -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
10
- 
11
- eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
12
---- a/auto/feature
13
-+++ b/auto/feature
14
-@@ -39,7 +39,7 @@ int main() {
15
- END
16
- 
17
- 
18
--ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
19
-+ngx_test="$CC $NGX_CC_OPT $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
20
-           -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs"
21
- 
22
- ngx_feature_inc_path=
23
---- a/auto/include
24
-+++ b/auto/include
25
-@@ -27,7 +27,7 @@ int main() {
26
- END
27
- 
28
- 
29
--ngx_test="$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
30
-+ngx_test="$CC $NGX_CC_OPT -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
31
- 
32
- eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
33
- 

+ 0
- 1183
net/nginx/patches/400-nginx-1.4.x_proxy_protocol_patch_v2.patch
File diff suppressed because it is too large
View File


+ 0
- 698
net/nginx/patches/401-nginx-1.4.0-syslog.patch View File

@@ -1,698 +0,0 @@
1
-Index: nginx-1.4.7/src/core/ngx_cycle.c
2
-===================================================================
3
---- nginx-1.4.7.orig/src/core/ngx_cycle.c
4
-+++ nginx-1.4.7/src/core/ngx_cycle.c
5
-@@ -85,6 +85,12 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
6
-     cycle->pool = pool;
7
-     cycle->log = log;
8
-     cycle->new_log.log_level = NGX_LOG_ERR;
9
-+#if (NGX_ENABLE_SYSLOG)
10
-+    cycle->new_log.facility = SYSLOG_FACILITY;
11
-+    cycle->new_log.facility = ERR_SYSLOG_PRIORITY;
12
-+    cycle->new_log.syslog_on = 0;
13
-+    cycle->new_log.syslog_set = 0;
14
-+#endif
15
-     cycle->old_cycle = old_cycle;
16
- 
17
-     cycle->conf_prefix.len = old_cycle->conf_prefix.len;
18
-Index: nginx-1.4.7/src/core/ngx_log.c
19
-===================================================================
20
---- nginx-1.4.7.orig/src/core/ngx_log.c
21
-+++ nginx-1.4.7/src/core/ngx_log.c
22
-@@ -10,6 +10,15 @@
23
- 
24
- 
25
- static char *ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
26
-+#if (NGX_ENABLE_SYSLOG)
27
-+static char *ngx_set_syslog(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
28
-+void log_exit(ngx_cycle_t *cycle);
29
-+
30
-+typedef struct{
31
-+    ngx_str_t     name;
32
-+    ngx_int_t     macro;
33
-+} ngx_string_to_macro_t;
34
-+#endif
35
- 
36
- 
37
- static ngx_command_t  ngx_errlog_commands[] = {
38
-@@ -21,6 +30,15 @@ static ngx_command_t  ngx_errlog_command
39
-      0,
40
-      NULL},
41
- 
42
-+#if (NGX_ENABLE_SYSLOG)
43
-+    {ngx_string("syslog"),
44
-+     NGX_MAIN_CONF|NGX_CONF_TAKE12,
45
-+     ngx_set_syslog,
46
-+     0,
47
-+     0,
48
-+     NULL},
49
-+#endif
50
-+
51
-     ngx_null_command
52
- };
53
- 
54
-@@ -43,7 +61,11 @@ ngx_module_t  ngx_errlog_module = {
55
-     NULL,                                  /* init thread */
56
-     NULL,                                  /* exit thread */
57
-     NULL,                                  /* exit process */
58
--    NULL,                                  /* exit master */
59
-+#if (NGX_ENABLE_SYSLOG)
60
-+    log_exit,                              /* exit master */
61
-+#else
62
-+    NULL,
63
-+#endif
64
-     NGX_MODULE_V1_PADDING
65
- };
66
- 
67
-@@ -52,6 +74,48 @@ static ngx_log_t        ngx_log;
68
- static ngx_open_file_t  ngx_log_file;
69
- ngx_uint_t              ngx_use_stderr = 1;
70
- 
71
-+#if (NGX_ENABLE_SYSLOG)
72
-+static ngx_string_to_macro_t ngx_syslog_facilities[] = {
73
-+    {ngx_string("auth"),     LOG_AUTH},
74
-+#if !(NGX_SOLARIS)
75
-+    {ngx_string("authpriv"), LOG_AUTHPRIV},
76
-+#endif
77
-+    {ngx_string("cron"),     LOG_CRON},
78
-+    {ngx_string("daemon"),   LOG_DAEMON},
79
-+#if !(NGX_SOLARIS)
80
-+    {ngx_string("ftp"),      LOG_FTP},
81
-+#endif
82
-+    {ngx_string("kern"),     LOG_KERN},
83
-+    {ngx_string("local0"),   LOG_LOCAL0},
84
-+    {ngx_string("local1"),   LOG_LOCAL1},
85
-+    {ngx_string("local2"),   LOG_LOCAL2},
86
-+    {ngx_string("local3"),   LOG_LOCAL3},
87
-+    {ngx_string("local4"),   LOG_LOCAL4},
88
-+    {ngx_string("local5"),   LOG_LOCAL5},
89
-+    {ngx_string("local6"),   LOG_LOCAL6},
90
-+    {ngx_string("local7"),   LOG_LOCAL7},
91
-+    {ngx_string("lpr"),      LOG_LPR},
92
-+    {ngx_string("mail"),     LOG_MAIL},
93
-+    {ngx_string("news"),     LOG_NEWS},
94
-+    {ngx_string("syslog"),   LOG_SYSLOG},
95
-+    {ngx_string("user"),     LOG_USER},
96
-+    {ngx_string("uucp"),     LOG_UUCP},
97
-+    { ngx_null_string, 0}
98
-+};
99
-+
100
-+static ngx_string_to_macro_t ngx_syslog_priorities[] = {
101
-+    {ngx_string("emerg"), LOG_EMERG},
102
-+    {ngx_string("alert"), LOG_ALERT},
103
-+    {ngx_string("crit"),  LOG_CRIT},
104
-+    {ngx_string("error"), LOG_ERR},
105
-+    {ngx_string("err"),   LOG_ERR},
106
-+    {ngx_string("warn"),  LOG_WARNING},
107
-+    {ngx_string("notice"),LOG_NOTICE},
108
-+    {ngx_string("info"),  LOG_INFO},
109
-+    {ngx_string("debug"), LOG_DEBUG},
110
-+    { ngx_null_string, 0}
111
-+};
112
-+#endif
113
- 
114
- static ngx_str_t err_levels[] = {
115
-     ngx_null_string,
116
-@@ -89,11 +153,16 @@ ngx_log_error_core(ngx_uint_t level, ngx
117
-     va_list  args;
118
- #endif
119
-     u_char  *p, *last, *msg;
120
-+#if (NGX_ENABLE_SYSLOG)
121
-+    u_char *errstr_syslog;
122
-+#endif
123
-     u_char   errstr[NGX_MAX_ERROR_STR];
124
- 
125
-+#if !(NGX_ENABLE_SYSLOG)
126
-     if (log->file->fd == NGX_INVALID_FILE) {
127
-         return;
128
-     }
129
-+#endif
130
- 
131
-     last = errstr + NGX_MAX_ERROR_STR;
132
- 
133
-@@ -102,6 +171,10 @@ ngx_log_error_core(ngx_uint_t level, ngx
134
- 
135
-     p = errstr + ngx_cached_err_log_time.len;
136
- 
137
-+#if (NGX_ENABLE_SYSLOG)
138
-+    errstr_syslog = p;
139
-+#endif
140
-+
141
-     p = ngx_slprintf(p, last, " [%V] ", &err_levels[level]);
142
- 
143
-     /* pid#tid */
144
-@@ -140,11 +213,27 @@ ngx_log_error_core(ngx_uint_t level, ngx
145
- 
146
-     ngx_linefeed(p);
147
- 
148
-+#if (NGX_ENABLE_SYSLOG)
149
-+    if (log->file != NULL && log->file->name.len != 0) {
150
-     (void) ngx_write_fd(log->file->fd, errstr, p - errstr);
151
-+    }
152
-+
153
-+    /* Don't send the debug level info to syslog */
154
-+    if (log->syslog_on && level < NGX_LOG_DEBUG) {
155
-+        /* write to syslog */
156
-+        syslog(log->priority, "%.*s", (int)(p - errstr_syslog), errstr_syslog);
157
-+    }
158
-+#else
159
-+    (void) ngx_write_fd(log->file->fd, errstr, p - errstr);
160
-+#endif
161
- 
162
-     if (!ngx_use_stderr
163
-         || level > NGX_LOG_WARN
164
-+#if (NGX_ENABLE_SYSLOG)
165
-+        || (log->file != NULL && log->file->fd == ngx_stderr))
166
-+#else
167
-         || log->file->fd == ngx_stderr)
168
-+#endif
169
-     {
170
-         return;
171
-     }
172
-@@ -367,6 +456,50 @@ ngx_log_create(ngx_cycle_t *cycle, ngx_s
173
- }
174
- 
175
- 
176
-+#if (NGX_ENABLE_SYSLOG)
177
-+ngx_int_t
178
-+ngx_log_get_priority(ngx_conf_t *cf, ngx_str_t *priority)
179
-+{
180
-+    ngx_int_t  p = 0;
181
-+    ngx_uint_t n, match = 0;
182
-+
183
-+    for (n = 0; ngx_syslog_priorities[n].name.len != 0; n++) {
184
-+        if (ngx_strncmp(priority->data, ngx_syslog_priorities[n].name.data, 
185
-+                    ngx_syslog_priorities[n].name.len) == 0) {
186
-+            p = ngx_syslog_priorities[n].macro;
187
-+            match = 1;
188
-+        }
189
-+    }
190
-+
191
-+    if (!match) {
192
-+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
193
-+                "invalid syslog priority \"%V\"", priority);
194
-+        return -1;
195
-+    }
196
-+
197
-+    return p;
198
-+}
199
-+
200
-+
201
-+char *
202
-+ngx_log_set_priority(ngx_conf_t *cf, ngx_str_t *priority, ngx_log_t *log)
203
-+{
204
-+    log->priority = ERR_SYSLOG_PRIORITY;
205
-+
206
-+    if (priority->len == 0) {
207
-+        return NGX_CONF_OK;
208
-+    }
209
-+
210
-+    log->priority = ngx_log_get_priority(cf, priority);
211
-+    if (log->priority == (-1)) {
212
-+        return NGX_CONF_ERROR;
213
-+    }
214
-+
215
-+    return NGX_CONF_OK;
216
-+}
217
-+#endif
218
-+
219
-+
220
- char *
221
- ngx_log_set_levels(ngx_conf_t *cf, ngx_log_t *log)
222
- {
223
-@@ -429,6 +562,13 @@ static char *
224
- ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
225
- {
226
-     ngx_str_t  *value, name;
227
-+#if (NGX_ENABLE_SYSLOG)
228
-+    u_char     *off = NULL;
229
-+    ngx_str_t  priority;
230
-+
231
-+    ngx_str_null(&name);
232
-+    ngx_str_null(&priority);
233
-+#endif
234
- 
235
-     if (cf->cycle->new_log.file) {
236
-         return "is duplicate";
237
-@@ -436,7 +576,44 @@ ngx_error_log(ngx_conf_t *cf, ngx_comman
238
- 
239
-     value = cf->args->elts;
240
- 
241
-+#if (NGX_ENABLE_SYSLOG)
242
-+    if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
243
-+        if (!cf->cycle->new_log.syslog_set) {
244
-+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
245
-+                    "You must set the syslog directive and enable it first.");
246
-+            return NGX_CONF_ERROR;
247
-+        }
248
-+
249
-+        cf->cycle->new_log.syslog_on = 1;
250
-+
251
-+        if (value[1].data[sizeof("syslog") - 1] == ':') {
252
-+            priority.len = value[1].len - sizeof("syslog");
253
-+            priority.data = value[1].data + sizeof("syslog");
254
-+
255
-+            off = (u_char *)ngx_strchr(priority.data, (int) '|');
256
-+            if (off != NULL) {
257
-+                priority.len = off - priority.data;
258
-+
259
-+                off++;
260
-+                name.len = value[1].data + value[1].len - off;
261
-+                name.data = off;
262
-+            }
263
-+        }
264
-+        else {
265
-+            if (value[1].len > sizeof("syslog")) {
266
-+                name.len = value[1].len - sizeof("syslog");
267
-+                name.data = value[1].data + sizeof("syslog");
268
-+            }
269
-+        }
270
-+
271
-+        if (ngx_log_set_priority(cf, &priority, &cf->cycle->new_log) == NGX_CONF_ERROR) {
272
-+            return NGX_CONF_ERROR;
273
-+        }
274
-+    }
275
-+    else if (ngx_strcmp(value[1].data, "stderr") == 0) {
276
-+#else
277
-     if (ngx_strcmp(value[1].data, "stderr") == 0) {
278
-+#endif
279
-         ngx_str_null(&name);
280
- 
281
-     } else {
282
-@@ -457,3 +634,63 @@ ngx_error_log(ngx_conf_t *cf, ngx_comman
283
- 
284
-     return ngx_log_set_levels(cf, &cf->cycle->new_log);
285
- }
286
-+
287
-+
288
-+#if (NGX_ENABLE_SYSLOG)
289
-+
290
-+#define SYSLOG_IDENT_NAME "nginx"
291
-+
292
-+static char *
293
-+ngx_set_syslog(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
294
-+{
295
-+    char       *program;
296
-+    ngx_str_t  *value;
297
-+    ngx_int_t   facility, match = 0;
298
-+    ngx_uint_t  n;
299
-+
300
-+    value = cf->args->elts;
301
-+
302
-+    if (cf->cycle->new_log.syslog_set) {
303
-+        return "is duplicate";
304
-+    }
305
-+
306
-+    cf->cycle->new_log.syslog_set = 1;
307
-+
308
-+    for (n = 0; ngx_syslog_facilities[n].name.len != 0; n++) {
309
-+        if (ngx_strncmp(value[1].data, ngx_syslog_facilities[n].name.data, 
310
-+                    ngx_syslog_facilities[n].name.len) == 0) {
311
-+            facility = ngx_syslog_facilities[n].macro;
312
-+            match = 1;
313
-+            break;
314
-+        }
315
-+    }
316
-+
317
-+    if (match) {
318
-+        cf->cycle->new_log.facility = facility;
319
-+        cf->cycle->new_log.priority = ERR_SYSLOG_PRIORITY;
320
-+    }
321
-+    else {
322
-+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
323
-+                "invalid syslog facility \"%V\"", &value[1]);
324
-+        return NGX_CONF_ERROR;
325
-+    }
326
-+
327
-+    program = SYSLOG_IDENT_NAME; 
328
-+    if (cf->args->nelts > 2) {
329
-+        program = (char *) value[2].data;
330
-+    }
331
-+
332
-+    openlog(program, LOG_ODELAY, facility);
333
-+
334
-+    return NGX_CONF_OK;
335
-+}
336
-+
337
-+
338
-+void log_exit(ngx_cycle_t *cycle)
339
-+{
340
-+    if (cycle->new_log.syslog_set) {
341
-+        closelog();
342
-+    }
343
-+}
344
-+#endif
345
-+
346
-Index: nginx-1.4.7/src/core/ngx_log.h
347
-===================================================================
348
---- nginx-1.4.7.orig/src/core/ngx_log.h
349
-+++ nginx-1.4.7/src/core/ngx_log.h
350
-@@ -12,6 +12,13 @@
351
- #include <ngx_config.h>
352
- #include <ngx_core.h>
353
- 
354
-+#if (NGX_ENABLE_SYSLOG)
355
-+#include <syslog.h>
356
-+
357
-+#define SYSLOG_FACILITY LOG_LOCAL5
358
-+#define ERR_SYSLOG_PRIORITY LOG_ERR
359
-+#endif
360
-+
361
- 
362
- #define NGX_LOG_STDERR            0
363
- #define NGX_LOG_EMERG             1
364
-@@ -61,6 +68,13 @@ struct ngx_log_s {
365
-      */
366
- 
367
-     char                *action;
368
-+
369
-+#if (NGX_ENABLE_SYSLOG)
370
-+    ngx_int_t           priority;
371
-+    ngx_int_t           facility;
372
-+    unsigned            syslog_on:1;      /* unsigned :1 syslog_on */
373
-+    unsigned            syslog_set:1;      /*unsigned :1 syslog_set */
374
-+#endif
375
- };
376
- 
377
- 
378
-@@ -221,6 +235,10 @@ void ngx_cdecl ngx_log_debug_core(ngx_lo
379
- 
380
- ngx_log_t *ngx_log_init(u_char *prefix);
381
- ngx_log_t *ngx_log_create(ngx_cycle_t *cycle, ngx_str_t *name);
382
-+#if (NGX_ENABLE_SYSLOG)
383
-+ngx_int_t ngx_log_get_priority(ngx_conf_t *cf, ngx_str_t *priority);
384
-+char * ngx_log_set_priority(ngx_conf_t *cf, ngx_str_t *priority, ngx_log_t *log);
385
-+#endif
386
- char *ngx_log_set_levels(ngx_conf_t *cf, ngx_log_t *log);
387
- void ngx_cdecl ngx_log_abort(ngx_err_t err, const char *fmt, ...);
388
- void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...);
389
-Index: nginx-1.4.7/src/http/modules/ngx_http_log_module.c
390
-===================================================================
391
---- nginx-1.4.7.orig/src/http/modules/ngx_http_log_module.c
392
-+++ nginx-1.4.7/src/http/modules/ngx_http_log_module.c
393
-@@ -13,6 +13,11 @@
394
- #include <zlib.h>
395
- #endif
396
- 
397
-+#if (NGX_ENABLE_SYSLOG)
398
-+#include <syslog.h>
399
-+
400
-+#define HTTP_SYSLOG_PRIORITY LOG_NOTICE
401
-+#endif
402
- 
403
- typedef struct ngx_http_log_op_s  ngx_http_log_op_t;
404
- 
405
-@@ -67,6 +72,11 @@ typedef struct {
406
-     time_t                      disk_full_time;
407
-     time_t                      error_log_time;
408
-     ngx_http_log_fmt_t         *format;
409
-+
410
-+#if (NGX_ENABLE_SYSLOG)
411
-+    ngx_int_t                   priority;
412
-+    unsigned                    syslog_on:1;      /* unsigned :1 syslog_on */
413
-+#endif
414
- } ngx_http_log_t;
415
- 
416
- 
417
-@@ -348,6 +358,14 @@ ngx_http_log_write(ngx_http_request_t *r
418
-     time_t               now;
419
-     ssize_t              n;
420
-     ngx_err_t            err;
421
-+
422
-+#if (NGX_ENABLE_SYSLOG)
423
-+    n = 0;
424
-+    if (log->syslog_on) {
425
-+        syslog(log->priority, "%.*s", (int)len, buf);
426
-+    }
427
-+#endif
428
-+
429
- #if (NGX_ZLIB)
430
-     ngx_http_log_buf_t  *buffer;
431
- #endif
432
-@@ -355,6 +373,9 @@ ngx_http_log_write(ngx_http_request_t *r
433
-     if (log->script == NULL) {
434
-         name = log->file->name.data;
435
- 
436
-+#if (NGX_ENABLE_SYSLOG)
437
-+        if (name != NULL) {
438
-+#endif
439
- #if (NGX_ZLIB)
440
-         buffer = log->file->data;
441
- 
442
-@@ -367,7 +388,11 @@ ngx_http_log_write(ngx_http_request_t *r
443
- #else
444
-         n = ngx_write_fd(log->file->fd, buf, len);
445
- #endif
446
--
447
-+#if (NGX_ENABLE_SYSLOG)
448
-+        } else {
449
-+            n = len;
450
-+        }
451
-+#endif
452
-     } else {
453
-         name = NULL;
454
-         n = ngx_http_log_script_write(r, log->script, &name, buf, len);
455
-@@ -1068,6 +1093,10 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *
456
-     log->script = NULL;
457
-     log->disk_full_time = 0;
458
-     log->error_log_time = 0;
459
-+#if (NGX_ENABLE_SYSLOG)
460
-+    log->priority = HTTP_SYSLOG_PRIORITY;
461
-+    log->syslog_on = 0;
462
-+#endif
463
- 
464
-     lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
465
-     fmt = lmcf->formats.elts;
466
-@@ -1096,6 +1125,13 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx
467
-     ngx_http_log_main_conf_t   *lmcf;
468
-     ngx_http_script_compile_t   sc;
469
- 
470
-+#if (NGX_ENABLE_SYSLOG)
471
-+    u_char                     *off;
472
-+    ngx_str_t                   priority;
473
-+    ngx_uint_t                  syslog_on = 0;
474
-+    name = priority = (ngx_str_t)ngx_null_string;
475
-+#endif
476
-+
477
-     value = cf->args->elts;
478
- 
479
-     if (ngx_strcmp(value[1].data, "off") == 0) {
480
-@@ -1108,6 +1144,38 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx
481
-                            "invalid parameter \"%V\"", &value[2]);
482
-         return NGX_CONF_ERROR;
483
-     }
484
-+#if (NGX_ENABLE_SYSLOG)
485
-+    else if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
486
-+        if (!cf->cycle->new_log.syslog_set) {
487
-+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
488
-+                               "You must set the syslog directive and enable it first.");
489
-+            return NGX_CONF_ERROR;
490
-+        }
491
-+
492
-+        syslog_on = 1;
493
-+        if (value[1].data[sizeof("syslog") - 1] == ':') {
494
-+            priority.len = value[1].len - sizeof("syslog");
495
-+            priority.data = value[1].data + sizeof("syslog");
496
-+
497
-+            off = (u_char*) ngx_strchr(priority.data, '|'); 
498
-+            if (off != NULL) {
499
-+                priority.len = off - priority.data;
500
-+                
501
-+                off++;
502
-+                name.len = value[1].data + value[1].len - off;
503
-+                name.data = off;
504
-+            }
505
-+        }
506
-+        else {
507
-+            if (value[1].len > sizeof("syslog")) {
508
-+                name.len = value[1].len - sizeof("syslog");
509
-+                name.data = value[1].data + sizeof("syslog");
510
-+            }
511
-+        }
512
-+    } else {
513
-+        name = value[1];
514
-+    }
515
-+#endif
516
- 
517
-     if (llcf->logs == NULL) {
518
-         llcf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t));
519
-@@ -1125,6 +1193,52 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx
520
- 
521
-     ngx_memzero(log, sizeof(ngx_http_log_t));
522
- 
523
-+#if (NGX_ENABLE_SYSLOG)
524
-+    log->syslog_on = syslog_on;
525
-+
526
-+    if (priority.len == 0) {
527
-+        log->priority = HTTP_SYSLOG_PRIORITY;
528
-+    }
529
-+    else {
530
-+        log->priority = ngx_log_get_priority(cf, &priority);
531
-+    }
532
-+
533
-+    if (name.len != 0) {
534
-+        n = ngx_http_script_variables_count(&name);
535
-+
536
-+        if (n == 0) {
537
-+            log->file = ngx_conf_open_file(cf->cycle, &name);
538
-+            if (log->file == NULL) {
539
-+                return NGX_CONF_ERROR;
540
-+            }
541
-+        } else {
542
-+            if (ngx_conf_full_name(cf->cycle, &name, 0) != NGX_OK) {
543
-+                return NGX_CONF_ERROR;
544
-+            }
545
-+            log->script = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_script_t));
546
-+            if (log->script == NULL) {
547
-+                return NGX_CONF_ERROR;
548
-+            }
549
-+            ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
550
-+            sc.cf = cf;
551
-+            sc.source = &name;
552
-+            sc.lengths = &log->script->lengths;
553
-+            sc.values = &log->script->values;
554
-+            sc.variables = n;
555
-+            sc.complete_lengths = 1;
556
-+            sc.complete_values = 1;
557
-+            if (ngx_http_script_compile(&sc) != NGX_OK) {
558
-+                return NGX_CONF_ERROR;
559
-+            }
560
-+        }
561
-+    }
562
-+    else {
563
-+        log->file = ngx_conf_open_file(cf->cycle, &name);
564
-+        if (log->file == NULL) {
565
-+            return NGX_CONF_ERROR;
566
-+        }
567
-+    }
568
-+#else
569
-     n = ngx_http_script_variables_count(&value[1]);
570
- 
571
-     if (n == 0) {
572
-@@ -1157,6 +1271,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx
573
-             return NGX_CONF_ERROR;
574
-         }
575
-     }
576
-+#endif
577
- 
578
-     if (cf->args->nelts >= 3) {
579
-         name = value[2];
580
-Index: nginx-1.4.7/src/http/ngx_http_core_module.c
581
-===================================================================
582
---- nginx-1.4.7.orig/src/http/ngx_http_core_module.c
583
-+++ nginx-1.4.7/src/http/ngx_http_core_module.c
584
-@@ -1462,6 +1462,9 @@ ngx_http_update_location_config(ngx_http
585
- 
586
-     if (r == r->main) {
587
-         ngx_http_set_connection_log(r->connection, clcf->error_log);
588
-+#if (NGX_ENABLE_SYSLOG)
589
-+        r->connection->log->priority = clcf->error_log->priority;
590
-+#endif
591
-     }
592
- 
593
-     if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) {
594
-@@ -4901,6 +4904,15 @@ ngx_http_core_error_log(ngx_conf_t *cf,
595
- 
596
-     ngx_str_t  *value, name;
597
- 
598
-+#if (NGX_ENABLE_SYSLOG)
599
-+    u_char     *off = NULL;
600
-+    ngx_int_t   syslog_on = 0;
601
-+    ngx_str_t   priority;
602
-+
603
-+    name = priority = (ngx_str_t) ngx_null_string;
604
-+#endif
605
-+
606
-+
607
-     if (clcf->error_log) {
608
-         return "is duplicate";
609
-     }
610
-@@ -4910,6 +4922,36 @@ ngx_http_core_error_log(ngx_conf_t *cf,
611
-     if (ngx_strcmp(value[1].data, "stderr") == 0) {
612
-         ngx_str_null(&name);
613
- 
614
-+#if (NGX_ENABLE_SYSLOG)
615
-+    } else if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
616
-+        if (!cf->cycle->new_log.syslog_set) {
617
-+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
618
-+                    "You must set the syslog directive and enable it first.");
619
-+            return NGX_CONF_ERROR;
620
-+        }
621
-+
622
-+        syslog_on = 1;
623
-+
624
-+        if (value[1].data[sizeof("syslog") - 1] == ':') {
625
-+            priority.len = value[1].len - sizeof("syslog");
626
-+            priority.data = value[1].data + sizeof("syslog");
627
-+
628
-+            off = (u_char*) ngx_strchr(priority.data, '|'); 
629
-+            if (off != NULL) {
630
-+                priority.len = off - priority.data;
631
-+
632
-+                off++;
633
-+                name.len = value[1].data + value[1].len - off;
634
-+                name.data = off;
635
-+            }
636
-+        }
637
-+        else {
638
-+            if (value[1].len > sizeof("syslog")) {
639
-+                name.len = value[1].len - sizeof("syslog");
640
-+                name.data = value[1].data + sizeof("syslog");
641
-+            }
642
-+        }
643
-+#endif
644
-     } else {
645
-         name = value[1];
646
-     }
647
-@@ -4919,6 +4961,17 @@ ngx_http_core_error_log(ngx_conf_t *cf,
648
-         return NGX_CONF_ERROR;
649
-     }
650
- 
651
-+#if (NGX_ENABLE_SYSLOG)
652
-+    if (syslog_on) {
653
-+        clcf->error_log->syslog_on = 1;
654
-+        if (ngx_log_set_priority(cf, &priority, clcf->error_log) == NGX_CONF_ERROR) {
655
-+            return NGX_CONF_ERROR;
656
-+        }
657
-+    }
658
-+
659
-+    clcf->error_log->log_level = 0;
660
-+#endif
661
-+
662
-     if (cf->args->nelts == 2) {
663
-         clcf->error_log->log_level = NGX_LOG_ERR;
664
-         return NGX_CONF_OK;
665
-Index: nginx-1.4.7/src/http/ngx_http_request.c
666
-===================================================================
667
---- nginx-1.4.7.orig/src/http/ngx_http_request.c
668
-+++ nginx-1.4.7/src/http/ngx_http_request.c
669
-@@ -533,6 +533,9 @@ ngx_http_create_request(ngx_connection_t
670
-     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
671
- 
672
-     ngx_http_set_connection_log(r->connection, clcf->error_log);
673
-+#if (NGX_ENABLE_SYSLOG)
674
-+    c->log->priority = clcf->error_log->priority;
675
-+#endif
676
- 
677
-     r->header_in = hc->nbusy ? hc->busy[0] : c->buffer;
678
- 
679
-@@ -872,6 +875,9 @@ ngx_http_ssl_servername(ngx_ssl_conn_t *
680
-     clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module);
681
- 
682
-     ngx_http_set_connection_log(c, clcf->error_log);
683
-+#if (NGX_ENABLE_SYSLOG)
684
-+    c->log->priority = clcf->error_log->priority;
685
-+#endif
686
- 
687
-     sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module);
688
- 
689
-@@ -2077,6 +2083,9 @@ ngx_http_set_virtual_server(ngx_http_req
690
-     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
691
- 
692
-     ngx_http_set_connection_log(r->connection, clcf->error_log);
693
-+#if (NGX_ENABLE_SYSLOG)
694
-+    r->connection->log->priority = clcf->error_log->priority;
695
-+#endif
696
- 
697
-     return NGX_OK;
698
- }