Skip to contentSkip to conversation

nginx: set sane defaults for temp directories

PATCH New Pascal Bach 1 participant 2 messages Mar 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 nginx: set sane defaults for temp directories

Currently the build directiories en up in /usr/*_temp which is not what most users will expect. This changes the default location to /tmp/nginx/*_tmp.

The location can still be overridden in the nginx.conf file.

---
 meta-webserver/recipes-httpd/nginx/nginx.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta-webserver/recipes-httpd/nginx/nginx.inc +5 -0
index e4e5f63..7f83937 100644
@@ -63,6 +63,11 @@ do_configure () {
     --conf-path=${sysconfdir}/nginx/nginx.conf \
     --http-log-path=${localstatedir}/log/nginx/access.log \
     --error-log-path=${localstatedir}/log/nginx/error.log \
+    --http-client-body-temp-path=/run/nginx/client_body_temp \
+    --http-proxy-temp-path=/run/nginx/proxy_temp \
+    --http-fastcgi-temp-path=/run/nginx/fastcgi_temp \
+    --http-uwsgi-temp-path=/run/nginx/uwsgi_temp \
+    --http-scgi-temp-path=/run/nginx/scgi_temp \
     --pid-path=/run/nginx/nginx.pid \
     --prefix=${prefix} \
     --with-http_ssl_module \
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 nginx: make sure the user is correctly set for the volatile directories

---
 meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf | 2 +-
 meta-webserver/recipes-httpd/nginx/nginx.inc                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta-webserver/recipes-httpd/nginx/files/nginx-volatile.conf +1 -1
index 93f3c66..472fde1 100644
@@ -1,2 +1,2 @@
-d www www-data 0755 /run/nginx none
+d @NGINX_USER@ www-data 0755 /run/nginx none
 d root root 0755 /var/log/nginx none
meta-webserver/recipes-httpd/nginx/nginx.inc +1 -0
index 7f83937..f98f299 100644
@@ -105,6 +105,7 @@ do_install () {
     install -d ${D}${sysconfdir}/default/volatiles
     install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
     sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx
+    sed -i 's,@NGINX_USER@,${NGINX_USER},g' ${D}${sysconfdir}/default/volatiles/99_nginx
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
         install -d ${D}${systemd_unitdir}/system
Signature · 1 line
2.1.4