Skip to content

Commit

Permalink
Merge pull request #23 from flownative/feature/flow-context-override
Browse files Browse the repository at this point in the history
Allow to override FLOW_CONTEXT with custom value
  • Loading branch information
kdambekalns authored Oct 2, 2024
2 parents a9b21a2 + e82031b commit c26f05e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
[![Maintenance level: Love](https://img.shields.io/badge/maintenance-%E2%99%A1%E2%99%A1%E2%99%A1-ff69b4.svg)](https://www.flownative.com/en/products/open-source.html)
![Nightly Builds](https://github.com/flownative/docker-nginx/workflows/Nightly%20Builds/badge.svg)
![Release to Docker Registries](https://github.com/flownative/docker-nginx/workflows/Release%20to%20Docker%20Registries/badge.svg)

![Build Docker Image daily](https://github.com/flownative/docker-nginx/actions/workflows/docker.build.yaml/badge.svg)
![Build Docker Image on tag](https://github.com/flownative/docker-nginx/actions/workflows/docker.build.onpush.yaml/badge.svg)
# Flownative Nginx Image

A Docker image providing [Nginx](https://nginx.org) for [Beach](https://www.flownative.com/beach),
Expand Down
13 changes: 7 additions & 6 deletions root-files/opt/flownative/lib/nginx-legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ nginx_legacy_env() {
export BEACH_APPLICATION_PATH=${BEACH_APPLICATION_PATH:-/application}
export BEACH_APPLICATION_PATH=${BEACH_APPLICATION_PATH%/}
export BEACH_FLOW_BASE_CONTEXT=${BEACH_FLOW_BASE_CONTEXT:-Production}
export BEACH_FLOW_SUB_CONTEXT=${BEACH_FLOW_SUB_CONTEXT:-}
if [ -z "${BEACH_FLOW_SUB_CONTEXT}" ]; then
export BEACH_FLOW_CONTEXT=${BEACH_FLOW_BASE_CONTEXT}/Beach/Instance
export BEACH_FLOW_SUB_CONTEXT=${BEACH_FLOW_SUB_CONTEXT:-Instance}
export BEACH_FLOW_CONTEXT=${BEACH_FLOW_BASE_CONTEXT}/Beach/${BEACH_FLOW_SUB_CONTEXT}
if [[ -v FLOW_CONTEXT ]]; then
export FLOW_CONTEXT
else
export BEACH_FLOW_CONTEXT=${BEACH_FLOW_BASE_CONTEXT}/Beach/${BEACH_FLOW_SUB_CONTEXT}
export FLOW_CONTEXT=${BEACH_FLOW_CONTEXT}
fi
export FLOW_HTTP_TRUSTED_PROXIES=${FLOW_HTTP_TRUSTED_PROXIES:-}
Expand Down Expand Up @@ -199,7 +200,7 @@ EOM
nginx_config_fastcgi_custom_error_page >>"${NGINX_CONF_PATH}/sites-enabled/site.conf"
fi
cat >>"${NGINX_CONF_PATH}/sites-enabled/site.conf" <<-EOM
fastcgi_param FLOW_CONTEXT ${BEACH_FLOW_CONTEXT};
fastcgi_param FLOW_CONTEXT ${FLOW_CONTEXT};
fastcgi_param FLOW_REWRITEURLS 1;
fastcgi_param FLOW_ROOTPATH ${BEACH_APPLICATION_PATH};
fastcgi_param FLOW_HTTP_TRUSTED_PROXIES ${FLOW_HTTP_TRUSTED_PROXIES};
Expand Down Expand Up @@ -375,7 +376,7 @@ server {
fastcgi_pass ${BEACH_PHP_FPM_HOST}:${BEACH_PHP_FPM_PORT};
fastcgi_index index.php;
fastcgi_param FLOW_CONTEXT ${BEACH_FLOW_CONTEXT};
fastcgi_param FLOW_CONTEXT ${FLOW_CONTEXT};
fastcgi_param FLOW_REWRITEURLS 1;
fastcgi_param FLOW_ROOTPATH ${BEACH_APPLICATION_PATH};
fastcgi_param FLOW_HTTP_TRUSTED_PROXIES ${FLOW_HTTP_TRUSTED_PROXIES};
Expand Down

0 comments on commit c26f05e

Please sign in to comment.