Skip to content

Commit

Permalink
Merge pull request #20 from flownative/underscores-in-headers
Browse files Browse the repository at this point in the history
Introduce NGINX_ENABLE_UNDERSCORES_IN_HEADERS
  • Loading branch information
robertlemke authored Feb 21, 2024
2 parents fd8ee3d + f632bb5 commit b703b83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Instead of the default format, a JSON format can be used by setting
| NGINX_AUTH_BASIC_REALM | string | off | Realm for HTTP Basic Authentication; if "off", authentication is disabled |
| NGINX_AUTH_BASIC_USERNAME | string | | Username for HTTP Basic Authentication |
| NGINX_AUTH_BASIC_ENCODED_HASHED_PASSWORD | string | | Base64-encoded hashed password (using httpasswd) for HTTP Basic Authentication |
| NGINX_ENABLE_UNDERSCORES_IN_HEADERS | boolean | no | Enables or disables the use of underscores in client request header fields. |
| BEACH_NGINX_CUSTOM_METRICS_ENABLE | boolean | no | If support for a custom metrics endpoint should be enabled |
| BEACH_NGINX_CUSTOM_METRICS_SOURCE_PATH | string | /metrics | Path where metrics are located |
| BEACH_NGINX_CUSTOM_METRICS_TARGET_PORT | integer | 8082 | Port at which Nginx should listen to provide the metrics for scraping |
Expand Down
11 changes: 11 additions & 0 deletions root-files/opt/flownative/lib/nginx-legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export NGINX_AUTH_BASIC_REALM=${NGINX_AUTH_BASIC_REALM:-off}
export NGINX_AUTH_BASIC_USERNAME=${NGINX_AUTH_BASIC_USERNAME:-}
export NGINX_AUTH_BASIC_ENCODED_HASHED_PASSWORD=${NGINX_AUTH_BASIC_ENCODED_HASHED_PASSWORD:-}
export NGINX_ENABLE_UNDERSCORES_IN_HEADERS=${NGINX_ENABLE_UNDERSCORES_IN_HEADERS:-no}
export NGINX_STATIC_ROOT=${NGINX_STATIC_ROOT:-/var/www/html}
EOF
}
Expand All @@ -92,6 +94,13 @@ nginx_legacy_initialize_flow() {
fi
fi

if is_boolean_yes "${NGINX_ENABLE_UNDERSCORES_IN_HEADERS}"; then
info "Nginx: Enabling underscores in headers ..."
underScoresInHeadersDirective="underscores_in_headers on;"
else
underScoresInHeadersDirective="underscores_in_headers off;"
fi

cat >"${NGINX_CONF_PATH}/sites-enabled/site.conf" <<-EOM
server {
Expand Down Expand Up @@ -308,6 +317,8 @@ server {
access_log off;
log_not_found off;
}
${underScoresInHeadersDirective}
}
EOM
}
Expand Down

0 comments on commit b703b83

Please sign in to comment.