summaryrefslogtreecommitdiffstats
path: root/projectroot
diff options
context:
space:
mode:
authorClemens Gruber <clemens.gruber@pqgruber.com>2016-11-29 17:29:01 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-11-30 14:13:10 +0100
commitd8f7550bc6d8c3ab6cb9c9982f973e393e8226f4 (patch)
tree3c45969f61b2f5dcafb4ddc181709aaa003cb329 /projectroot
parent23ec30258a17884d8ccee943c13187ab701eeff3 (diff)
downloadptxdist-d8f7550bc6d8c3ab6cb9c9982f973e393e8226f4.tar.gz
ptxdist-d8f7550bc6d8c3ab6cb9c9982f973e393e8226f4.tar.xz
nginx: new package
Add nginx package. Heavily inspired by Buildroot's nginx.mk, using their revised patches for 1.10.x and the endian patch from Marc Kleine-Budde, as well as the nginx.make from the patchset Robert sent, as a starting point. But instead of building the modules by default, each module is selectable in PTXdist, to allow reducing the binary size. Most popular modules are supported, systemd unit file and basic configuration files are included as well. Supports SSL, HTTP/2, HTTP Proxying, GZIP, Auth Basic, Rewrite, FastCGI, SCGI, uWSGI, etc. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> [mol: regenerate patches with git-ptx-patches] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'projectroot')
-rw-r--r--projectroot/etc/nginx/nginx.conf39
-rw-r--r--projectroot/lib/systemd/system/nginx.service14
-rw-r--r--projectroot/usr/lib/tmpfiles.d/nginx.conf10
3 files changed, 63 insertions, 0 deletions
diff --git a/projectroot/etc/nginx/nginx.conf b/projectroot/etc/nginx/nginx.conf
new file mode 100644
index 000000000..5801e1226
--- /dev/null
+++ b/projectroot/etc/nginx/nginx.conf
@@ -0,0 +1,39 @@
+worker_processes 1; # Enough for most webservers and incurs less latency
+#worker_processes auto; # Auto-detect based on CPU count
+
+events {
+ use epoll;
+ worker_connections 1024;
+ #multi_accept on; # Should be enabled if worker_processes > 1
+}
+
+http {
+ server_tokens off;
+
+ sendfile on;
+
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ access_log off;
+ error_log stderr;
+
+ gzip on;
+ gzip_disable "msie6";
+
+ server {
+ listen 80;
+ listen [::]:80;
+ server_name _;
+
+ index index.html;
+ root /var/www;
+
+ location / {
+ # First attempt to serve request as file, then
+ # as directory, then fall back to displaying a 404.
+ try_files $uri $uri/ =404;
+ }
+ }
+}
+
diff --git a/projectroot/lib/systemd/system/nginx.service b/projectroot/lib/systemd/system/nginx.service
new file mode 100644
index 000000000..a6a1a4d70
--- /dev/null
+++ b/projectroot/lib/systemd/system/nginx.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=NGINX HTTP and reverse proxy server
+After=syslog.target network.target nss-lookup.target
+
+[Service]
+Type=forking
+PIDFile=/run/nginx.pid
+ExecStartPre=/usr/sbin/nginx -t
+ExecStart=/usr/sbin/nginx
+ExecReload=/bin/kill -s HUP $MAINPID
+ExecStop=/bin/kill -s QUIT $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/projectroot/usr/lib/tmpfiles.d/nginx.conf b/projectroot/usr/lib/tmpfiles.d/nginx.conf
new file mode 100644
index 000000000..138b675f9
--- /dev/null
+++ b/projectroot/usr/lib/tmpfiles.d/nginx.conf
@@ -0,0 +1,10 @@
+# systemd tmpfile settings for nginx
+# See tmpfiles.d(5) for details
+
+d /var/log/nginx 0755 root root -
+d /var/tmp/nginx 0755 www www
+d /var/tmp/nginx/client 0755 www www
+d /var/tmp/nginx/proxy 0755 www www
+d /var/tmp/nginx/fastcgi 0755 www www
+d /var/tmp/nginx/scgi 0755 www www
+d /var/tmp/nginx/uwsgi 0755 www www