REVERSE_PROXY_HEADERS - use proxy_set_header instead of more_set_headers
This commit is contained in:
parent
0b22209c96
commit
0d3658adf0
13
README.md
13
README.md
@ -447,10 +447,10 @@ By default, *bunkerized-nginx* runs as non-root user inside the container and sh
|
|||||||
docker run ... --drop-cap=all ... bunkerity/bunkerized-nginx
|
docker run ... --drop-cap=all ... bunkerity/bunkerized-nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
## User namespace remap
|
### User namespace remap
|
||||||
Another hardening trick is [user namespace remapping](https://docs.docker.com/engine/security/userns-remap/) : it allows you to map the UID/GID of users inside a container to another UID/GID on the host. For example, you can map the user nginx with UID 101 inside the container to a non-existent user with UID 100101 on the host.
|
Another hardening trick is [user namespace remapping](https://docs.docker.com/engine/security/userns-remap/) : it allows you to map the UID/GID of users inside a container to another UID/GID on the host. For example, you can map the user nginx with UID/GID 101 inside the container to a non-existent user with UID/GID 100101 on the host.
|
||||||
|
|
||||||
Let's assume you have the /etc/subuid and /etc/subgid like this :
|
Let's assume you have the /etc/subuid and /etc/subgid files like this :
|
||||||
```
|
```
|
||||||
user:100000:65536
|
user:100000:65536
|
||||||
```
|
```
|
||||||
@ -665,11 +665,10 @@ Only valid when `USE_REVERSE_PROXY` is set to *yes*. Set it to *yes* when the co
|
|||||||
You can set multiple url/host by adding a suffix number to the variable name like this : `REVERSE_PROXY_WS_1`, `REVERSE_PROXY_WS_2`, `REVERSE_PROXY_WS_3`, ...
|
You can set multiple url/host by adding a suffix number to the variable name like this : `REVERSE_PROXY_WS_1`, `REVERSE_PROXY_WS_2`, `REVERSE_PROXY_WS_3`, ...
|
||||||
|
|
||||||
`REVERSE_PROXY_HEADERS`
|
`REVERSE_PROXY_HEADERS`
|
||||||
Values : *\<list of custom headers separated with a semicolon\>*
|
Values : *\<list of custom headers separated with a semicolon like this : header1 value1;header2 value2...\>*
|
||||||
Examples : Access-Control-Allow-Origin 'https://mydomain.dev'; Custom_Api_Header 'test';
|
Default value :
|
||||||
Default value : ""
|
|
||||||
Context : *global*, *multisite*
|
Context : *global*, *multisite*
|
||||||
Only valid when `USE_REVERSE_PROXY` is set to *yes*. Set it to *yes* when the corresponding `REVERSE_PROXY_HOST` is a WebSocket server.
|
Only valid when `USE_REVERSE_PROXY` is set to *yes*.
|
||||||
You can set multiple url/host by adding a suffix number to the variable name like this : `REVERSE_PROXY_HEADERS_1`, `REVERSE_PROXY_HEADERS_2`, `REVERSE_PROXY_HEADERS_3`, ...
|
You can set multiple url/host by adding a suffix number to the variable name like this : `REVERSE_PROXY_HEADERS_1`, `REVERSE_PROXY_HEADERS_2`, `REVERSE_PROXY_HEADERS_3`, ...
|
||||||
|
|
||||||
`PROXY_REAL_IP`
|
`PROXY_REAL_IP`
|
||||||
|
|||||||
@ -68,10 +68,10 @@ if [ "$USE_REVERSE_PROXY" = "yes" ] ; then
|
|||||||
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_URL%" "$url_value"
|
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_URL%" "$url_value"
|
||||||
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_HOST%" "$host_value"
|
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_HOST%" "$host_value"
|
||||||
if [ "$custom_headers_value" != "" ] ; then
|
if [ "$custom_headers_value" != "" ] ; then
|
||||||
IFS_=$IFS
|
IFS_$IFS
|
||||||
IFS=';'
|
IFS=';'
|
||||||
for header_value in $(echo "$custom_headers_value") ; do
|
for header_value in $(echo $custom_headers_value) ; do
|
||||||
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_CUSTOM_HEADERS%" "more_set_headers $header_value;\n%REVERSE_PROXY_CUSTOM_HEADERS%"
|
replace_in_file "${NGINX_PREFIX}reverse-proxy-${i}.conf" "%REVERSE_PROXY_CUSTOM_HEADERS%" "proxy_set_header $header_value;\n%REVERSE_PROXY_CUSTOM_HEADERS%"
|
||||||
done
|
done
|
||||||
IFS=$IFS_
|
IFS=$IFS_
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user