diff options
| author | Maxin John <maxin.john@gehealthcare.com> | 2024-07-23 02:38:59 +0300 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-07-23 08:41:14 -0700 |
| commit | a944926d1931bc931bacd90f19824a427408bb40 (patch) | |
| tree | 1dd2322369558a0eedbdb76693d8f90336d847ca /meta-webserver/recipes-httpd | |
| parent | ec3dc9a9fd24bb1762fe33f7e58db8b4081c7a5b (diff) | |
| download | meta-openembedded-a944926d1931bc931bacd90f19824a427408bb40.tar.gz | |
nginx: add PACKAGECONFIG knobs for fastcgi, scgi and uwsgi
fastcgi, scgi and uwsgi are enabled by default in nginx. Provide an
option to disable these features (that reduces binary size by 8%).
Signed-off-by: Maxin John <maxin.john@gehealthcare.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-webserver/recipes-httpd')
| -rw-r--r-- | meta-webserver/recipes-httpd/nginx/nginx.inc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/meta-webserver/recipes-httpd/nginx/nginx.inc b/meta-webserver/recipes-httpd/nginx/nginx.inc index 2714c3d22f..bcc384bd8a 100644 --- a/meta-webserver/recipes-httpd/nginx/nginx.inc +++ b/meta-webserver/recipes-httpd/nginx/nginx.inc | |||
| @@ -38,7 +38,7 @@ NGINX_USER ?= "www" | |||
| 38 | EXTRA_OECONF = "" | 38 | EXTRA_OECONF = "" |
| 39 | DISABLE_STATIC = "" | 39 | DISABLE_STATIC = "" |
| 40 | 40 | ||
| 41 | PACKAGECONFIG ??= "ssl ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" | 41 | PACKAGECONFIG ??= "ssl fastcgi scgi uwsgi ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" |
| 42 | 42 | ||
| 43 | PACKAGECONFIG[gunzip] = "--with-http_gunzip_module,," | 43 | PACKAGECONFIG[gunzip] = "--with-http_gunzip_module,," |
| 44 | PACKAGECONFIG[http2] = "--with-http_v2_module,," | 44 | PACKAGECONFIG[http2] = "--with-http_v2_module,," |
| @@ -48,7 +48,9 @@ PACKAGECONFIG[ipv6] = "--with-ipv6,," | |||
| 48 | PACKAGECONFIG[webdav] = "--with-http_dav_module,," | 48 | PACKAGECONFIG[webdav] = "--with-http_dav_module,," |
| 49 | PACKAGECONFIG[stream] = "--with-stream,," | 49 | PACKAGECONFIG[stream] = "--with-stream,," |
| 50 | PACKAGECONFIG[http-sub-module] = "--with-http_sub_module,," | 50 | PACKAGECONFIG[http-sub-module] = "--with-http_sub_module,," |
| 51 | 51 | PACKAGECONFIG[fastcgi] = ",--without-http_fastcgi_module," | |
| 52 | PACKAGECONFIG[scgi] = ",--without-http_scgi_module," | ||
| 53 | PACKAGECONFIG[uwsgi] = ",--without-http_uwsgi_module," | ||
| 52 | PACKAGECONFIG[xslt] = "--with-http_xslt_module,,libxslt" | 54 | PACKAGECONFIG[xslt] = "--with-http_xslt_module,,libxslt" |
| 53 | 55 | ||
| 54 | do_configure () { | 56 | do_configure () { |
| @@ -81,9 +83,9 @@ do_configure () { | |||
| 81 | --error-log-path=${localstatedir}/log/nginx/error.log \ | 83 | --error-log-path=${localstatedir}/log/nginx/error.log \ |
| 82 | --http-client-body-temp-path=/run/nginx/client_body_temp \ | 84 | --http-client-body-temp-path=/run/nginx/client_body_temp \ |
| 83 | --http-proxy-temp-path=/run/nginx/proxy_temp \ | 85 | --http-proxy-temp-path=/run/nginx/proxy_temp \ |
| 84 | --http-fastcgi-temp-path=/run/nginx/fastcgi_temp \ | 86 | ${@bb.utils.contains('PACKAGECONFIG', 'fastcgi', '--http-fastcgi-temp-path=/run/nginx/fastcgi_temp', '', d)} \ |
| 85 | --http-uwsgi-temp-path=/run/nginx/uwsgi_temp \ | 87 | ${@bb.utils.contains('PACKAGECONFIG', 'scgi', '--http-scgi-temp-path=/run/nginx/scgi_temp', '', d)} \ |
| 86 | --http-scgi-temp-path=/run/nginx/scgi_temp \ | 88 | ${@bb.utils.contains('PACKAGECONFIG', 'uwsgi', '--http-uwsgi-temp-path=/run/nginx/uwsgi_temp', '', d)} \ |
| 87 | --pid-path=/run/nginx/nginx.pid \ | 89 | --pid-path=/run/nginx/nginx.pid \ |
| 88 | --prefix=${prefix} \ | 90 | --prefix=${prefix} \ |
| 89 | --with-threads \ | 91 | --with-threads \ |
| @@ -132,6 +134,18 @@ do_install () { | |||
| 132 | # cleanup configuration folder | 134 | # cleanup configuration folder |
| 133 | rm ${D}${sysconfdir}/nginx/*.default | 135 | rm ${D}${sysconfdir}/nginx/*.default |
| 134 | 136 | ||
| 137 | # remove config files based on packageconfig | ||
| 138 | if ! [ "${@bb.utils.filter('PACKAGECONFIG', 'fastcgi', d)}" ]; then | ||
| 139 | rm -f ${D}${sysconfdir}/nginx/fastcgi.conf | ||
| 140 | rm -f ${D}${sysconfdir}/nginx/fastcgi_params | ||
| 141 | fi | ||
| 142 | if ! [ "${@bb.utils.filter('PACKAGECONFIG', 'scgi', d)}" ]; then | ||
| 143 | rm -f ${D}${sysconfdir}/nginx/scgi_params | ||
| 144 | fi | ||
| 145 | if ! [ "${@bb.utils.filter('PACKAGECONFIG', 'uwsgi', d)}" ]; then | ||
| 146 | rm -f ${D}${sysconfdir}/nginx/uwsgi_params | ||
| 147 | fi | ||
| 148 | |||
| 135 | # add additional configuration folders | 149 | # add additional configuration folders |
| 136 | install -d ${D}${sysconfdir}/nginx/modules-available | 150 | install -d ${D}${sysconfdir}/nginx/modules-available |
| 137 | install -d ${D}${sysconfdir}/nginx/modules-enabled | 151 | install -d ${D}${sysconfdir}/nginx/modules-enabled |
