[oe-commits] [meta-openembedded] 08/11: nginx: add default proxy_params

git at git.openembedded.org git at git.openembedded.org
Sat Jan 19 16:35:41 UTC 2019


This is an automated email from the git hooks/post-receive script.

khem pushed a commit to branch master-next
in repository meta-openembedded.

commit 1f60e36699532f2ec2bf7b4e90b4c25a90fe8a54
Author: André Draszik <andre.draszik at jci.com>
AuthorDate: Fri Jan 18 15:03:23 2019 +0000

    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 at jci.com>
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 meta-webserver/recipes-httpd/nginx/files/proxy_params | 4 ++++
 meta-webserver/recipes-httpd/nginx/nginx.inc          | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/meta-webserver/recipes-httpd/nginx/files/proxy_params b/meta-webserver/recipes-httpd/nginx/files/proxy_params
new file mode 100644
index 0000000..df75bc5
--- /dev/null
+++ b/meta-webserver/recipes-httpd/nginx/files/proxy_params
@@ -0,0 +1,4 @@
+proxy_set_header Host $http_host;
+proxy_set_header X-Real-IP $remote_addr;
+proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+proxy_set_header X-Forwarded-Proto $scheme;
diff --git a/meta-webserver/recipes-httpd/nginx/nginx.inc b/meta-webserver/recipes-httpd/nginx/nginx.inc
index 5229425..29e7efc 100644
--- a/meta-webserver/recipes-httpd/nginx/nginx.inc
+++ b/meta-webserver/recipes-httpd/nginx/nginx.inc
@@ -17,6 +17,7 @@ SRC_URI = " \
     file://0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch \
     file://nginx.conf \
     file://default_server.site \
+    file://proxy_params \
     file://nginx.init \
     file://nginx-volatile.conf \
     file://nginx.service \
@@ -111,6 +112,8 @@ do_install () {
     install -d ${D}${sysconfdir}/nginx/sites-enabled
     ln -s ../sites-available/default_server ${D}${sysconfdir}/nginx/sites-enabled/
 
+    install -m 0644 ${WORKDIR}/proxy_params ${D}${sysconfdir}/nginx/proxy_params
+
     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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list