Commit Graph

24 Commits

Author SHA1 Message Date
Yi Zhao
6e9f393605 nginx: remove /var/log/nginx when do_install
Remove directory /var/log/nginx when do_install because it is created by
volatiles file.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-05-06 12:51:39 -07:00
Changqing Li
fc8f28c611 nginx: fix error during service startup
fix below error:
nginx.service: failed to parse pid from file /run/nginx/nginx.pid:
invalid argument

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-02-26 07:17:58 -08:00
Gaylord Charles
35dddf62f5 nginx: fix install paths
This patch fixes Nginx install paths. I tried to build the native variant
for testing purpose and had errors.

- Use path variable instead of /usr
- Replace the absolute path symlink with a relative one

Signed-off-by: Gaylord CHARLES <gaylord.charles@veo-labs.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-11-17 12:34:21 -08:00
nick83ola
dd5622ef2b nginx: fix kill path in nginx systemd unit file
the kill utility is located in /bin/kill -> use base_bindir instead of bindir

Signed-off-by: Nicola Lunghi <nick83ola@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-05-27 09:48:07 -07:00
nick83ola
acb604775e nginx: add PACKAGECONFIG[http-auth-request]
Signed-off-by: Nicola Lunghi <nick83ola@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-05-27 09:48:07 -07:00
André Draszik
eaedfa5e0e nginx: add default proxy_params
As per Debian packaging - to use it, see
    https://wiki.debian.org/Nginx/DirectoryStructure#Extra_Parameters

    This file is most commonly included when Nginx is acting
    as a reverse proxy:
        include /etc/nginx/proxy_params;
        proxy_pass http://localhost:8000;

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-01-19 10:06:20 -08:00
André Draszik
22e17bb10c nginx: configuration update
Restructure the main configuration file to simplify custom configuration:
* support inclusion of configuration fragments from subdirectories:
  - /etc/nginx/modules-enabled/*.conf
  - /etc/nginx/conf.d/*.conf
  - /etc/nginx/sites-enabled/*
* default site (port 80):
  - move into /etc/nginx/sites-available/default_server
    and enable via symlink in /etc/nginx/sites-enabled/
  - listen on IPv6
  - drop unneeded example fragments
* configure and enable gzip
* update TLS settings to drop SSLv3 and enable TLSv1.3 for some safer
  defaults
* update remaining bits to follow Debian standard configuration
  62a54a8ba6/debian/conf/nginx.conf
* drop unneeded example configuration bits from /etc/nginx/*.default

These changes, in particular the configuration fragment
support allow to easily customise nginx based on individual
requirements.
In addition, it is now possible for other recipes / packages
to drop fragments into the respective directories in /etc/nginx
without having to meddle with /etc/nginx/nginx.conf

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-01-19 10:06:20 -08:00
André Draszik
a0eadda910 nginx: update systemd unit using nginx recommendation
Our systemd unit doesn't follow the official
recommendation, see
    https://www.nginx.com/resources/wiki/start/topics/examples/systemd/

Most importantly:
* it should start after some additional specific
  targets/units
* using PrivateTmp is a useful security feature, in
  particular to avoid cross domain scripting via the
  temp folder
* using systemd's $MAINPID, we can distinguish between
  multiple running nginx instances correctly

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-01-19 10:06:20 -08:00
Max Kellermann
4e389f64d7 nginx: add PACKAGECONFIG[ssl]
Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-09-24 11:49:45 -07:00
Derek Straka
7cb4eb4a95 nginx: enable thread pools by default
The thread pool feature can be enabled without significant extra binary size.  Thread pools can increase performance by an order of magnitude on some configurations

Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-07-12 07:19:42 -07:00
Martin Jansa
99aa19ff53 recipes: use oe.utils.conditional instead of deprecated base_conditional
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2018-02-01 13:48:27 +00:00
Derek Straka
c0b74f42e0 nginx: correctly set the endianness of the target
Add an inherit for siteinfo to get access to SITEINFO_ENDIANNESS
Add a patch to have nginx actually use the user provided --with-endian

Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2017-12-11 07:58:56 -08:00
Szombathelyi György
9205bd846c Nginx: use PACKAGECONFIG variables in configure
Signed-off-by: Gyorgy Szombathelyi <gyurco@freemail.hu>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2017-09-18 10:18:12 +02:00
Pascal Bach
945cdceca4 nginx: depend on zlib instead of gzip
nginx requires zlib not gzip for compression.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2017-06-12 06:56:24 +02:00
Pascal Bach
d050a35031 nginx: make sure the user is correctly set for the volatile directories
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2017-03-31 13:26:00 +02:00
Pascal Bach
a4e4cfd932 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.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2017-03-31 13:26:00 +02:00
Alexandre Belloni
1d1a43bb06 nginx: handle systemd service file
Inherit the systemd class so the service file is properly handled.
Note that by default, the service file will be installed but not enabled.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2017-02-13 18:43:29 +01:00
Martin Jansa
f2bec07b87 nginx.inc: use 4 spaces for indentation
* like any other sane recipes do

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-08-22 15:53:57 +02:00
Szombathelyi György
8e6425cfa1 nginx: optimize systemd unit file
- Call the nginx binary directly, no need to wrap the SysV init file.
- Create /var/log/nginx with tmpfiles, like volatiles without systemd.
- Run nginx with ${NGINX_USER} (user ${NGINX_USER} in nginx.conf)

Signed-off-by: Gyorgy Szombathelyi <gyurco@freemail.hu>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-08-22 15:52:32 +02:00
Szombathelyi György
469a6ca5b8 nginx: PACKAGECONFIG for httpv2
Signed-off-by: Gyorgy Szombathelyi <gyurco@freemail.hu>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-08-22 15:49:24 +02:00
Derek Straka
ea75c65637 nginx: add the LDFLAGS to the link arguments
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-08-15 12:32:00 +02:00
Ross Burton
e5c807b77f meta-webserver: use bb.utils.contains() instead of base_contains()
base_contains() is a compatibility wrapper and may warn in the future, so
replace all instances with bb.utils.contains().

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-04-28 10:38:38 +02:00
Pascal Bach
6605e7f52f nginx: add stable version 1.8.1 as alternative to the mainline version 1.9.x
The 1.8 branch is the current stable branch of nginx.
This means the branch doesn't get new features, but is still supported with bugfixes.

Depending on the use case it is more suitable to use on an embedded device
than the 1.9 branch which adds new features with every release.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
2016-03-25 11:26:57 +01:00
Pascal Bach
d5eec8b7f3 nginx: split parts out of the recipe into nginx.inc
nginx has two maintained branches.
- stable: is the long term maintained branch where only bugfixes occur
- mainline: is the branch where new features get added

This change is in preparation to support these two branches.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
2016-03-25 11:26:57 +01:00