Skip to content

Commit b703b83

Browse files
authored
Merge pull request #20 from flownative/underscores-in-headers
Introduce NGINX_ENABLE_UNDERSCORES_IN_HEADERS
2 parents fd8ee3d + f632bb5 commit b703b83

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Instead of the default format, a JSON format can be used by setting
8383
| NGINX_AUTH_BASIC_REALM | string | off | Realm for HTTP Basic Authentication; if "off", authentication is disabled |
8484
| NGINX_AUTH_BASIC_USERNAME | string | | Username for HTTP Basic Authentication |
8585
| NGINX_AUTH_BASIC_ENCODED_HASHED_PASSWORD | string | | Base64-encoded hashed password (using httpasswd) for HTTP Basic Authentication |
86+
| NGINX_ENABLE_UNDERSCORES_IN_HEADERS | boolean | no | Enables or disables the use of underscores in client request header fields. |
8687
| BEACH_NGINX_CUSTOM_METRICS_ENABLE | boolean | no | If support for a custom metrics endpoint should be enabled |
8788
| BEACH_NGINX_CUSTOM_METRICS_SOURCE_PATH | string | /metrics | Path where metrics are located |
8889
| BEACH_NGINX_CUSTOM_METRICS_TARGET_PORT | integer | 8082 | Port at which Nginx should listen to provide the metrics for scraping |

root-files/opt/flownative/lib/nginx-legacy.sh

+11
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export NGINX_AUTH_BASIC_REALM=${NGINX_AUTH_BASIC_REALM:-off}
6868
export NGINX_AUTH_BASIC_USERNAME=${NGINX_AUTH_BASIC_USERNAME:-}
6969
export NGINX_AUTH_BASIC_ENCODED_HASHED_PASSWORD=${NGINX_AUTH_BASIC_ENCODED_HASHED_PASSWORD:-}
7070
71+
export NGINX_ENABLE_UNDERSCORES_IN_HEADERS=${NGINX_ENABLE_UNDERSCORES_IN_HEADERS:-no}
72+
7173
export NGINX_STATIC_ROOT=${NGINX_STATIC_ROOT:-/var/www/html}
7274
EOF
7375
}
@@ -92,6 +94,13 @@ nginx_legacy_initialize_flow() {
9294
fi
9395
fi
9496

97+
if is_boolean_yes "${NGINX_ENABLE_UNDERSCORES_IN_HEADERS}"; then
98+
info "Nginx: Enabling underscores in headers ..."
99+
underScoresInHeadersDirective="underscores_in_headers on;"
100+
else
101+
underScoresInHeadersDirective="underscores_in_headers off;"
102+
fi
103+
95104
cat >"${NGINX_CONF_PATH}/sites-enabled/site.conf" <<-EOM
96105
97106
server {
@@ -308,6 +317,8 @@ server {
308317
access_log off;
309318
log_not_found off;
310319
}
320+
321+
${underScoresInHeadersDirective}
311322
}
312323
EOM
313324
}

0 commit comments

Comments
 (0)