summaryrefslogtreecommitdiffstats
path: root/meta-webserver
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2019-01-18 15:03:23 +0000
committerKhem Raj <raj.khem@gmail.com>2019-01-19 10:06:20 -0800
commiteaedfa5e0e92e20065a2f95a4dc40311edc686fa (patch)
tree1d0ed031612206df92091d1127146f4b060a2b73 /meta-webserver
parent22e17bb10c589775b3196b07bde4912658a5dcbd (diff)
downloadmeta-openembedded-eaedfa5e0e92e20065a2f95a4dc40311edc686fa.tar.gz
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>
Diffstat (limited to 'meta-webserver')
-rw-r--r--meta-webserver/recipes-httpd/nginx/files/proxy_params4
-rw-r--r--meta-webserver/recipes-httpd/nginx/nginx.inc3
2 files changed, 7 insertions, 0 deletions
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 @@
1proxy_set_header Host $http_host;
2proxy_set_header X-Real-IP $remote_addr;
3proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
4proxy_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 = " \
17 file://0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch \ 17 file://0001-Allow-the-overriding-of-the-endianness-via-the-confi.patch \
18 file://nginx.conf \ 18 file://nginx.conf \
19 file://default_server.site \ 19 file://default_server.site \
20 file://proxy_params \
20 file://nginx.init \ 21 file://nginx.init \
21 file://nginx-volatile.conf \ 22 file://nginx-volatile.conf \
22 file://nginx.service \ 23 file://nginx.service \
@@ -111,6 +112,8 @@ do_install () {
111 install -d ${D}${sysconfdir}/nginx/sites-enabled 112 install -d ${D}${sysconfdir}/nginx/sites-enabled
112 ln -s ../sites-available/default_server ${D}${sysconfdir}/nginx/sites-enabled/ 113 ln -s ../sites-available/default_server ${D}${sysconfdir}/nginx/sites-enabled/
113 114
115 install -m 0644 ${WORKDIR}/proxy_params ${D}${sysconfdir}/nginx/proxy_params
116
114 install -d ${D}${sysconfdir}/default/volatiles 117 install -d ${D}${sysconfdir}/default/volatiles
115 install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx 118 install -m 0644 ${WORKDIR}/nginx-volatile.conf ${D}${sysconfdir}/default/volatiles/99_nginx
116 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx 119 sed -i 's,/var/,${localstatedir}/,g' ${D}${sysconfdir}/default/volatiles/99_nginx