From: "André Draszik" <git@andred.net>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-webserver][PATCH] nginx: add default proxy_params
Date: Fri, 18 Jan 2019 15:03:23 +0000 [thread overview]
Message-ID: <20190118150323.17306-1-git@andred.net> (raw)
From: André Draszik <andre.draszik@jci.com>
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>
---
meta-webserver/recipes-httpd/nginx/files/proxy_params | 4 ++++
meta-webserver/recipes-httpd/nginx/nginx.inc | 3 +++
2 files changed, 7 insertions(+)
create mode 100644 meta-webserver/recipes-httpd/nginx/files/proxy_params
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 000000000..df75bc5d7
--- /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 522942504..29e7efc14 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
--
2.20.1
reply other threads:[~2019-01-18 15:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190118150323.17306-1-git@andred.net \
--to=git@andred.net \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox