diff --git a/kubernetes/configmap/nginx.yaml b/kubernetes/configmap/nginx.yaml index 1683c06..4eaa9bc 100644 --- a/kubernetes/configmap/nginx.yaml +++ b/kubernetes/configmap/nginx.yaml @@ -285,6 +285,9 @@ data: fastcgi_pass php-upstream; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root/imageResizer.php; + fastcgi_param HTTPS $http_x_forwarded_proto; + fastcgi_param HTTP_HOST $request_host; + fastcgi_param REQUEST_SCHEME $http_x_forwarded_proto; } # plain 404 page for missing files accessed via CDN diff --git a/tests/README.md b/tests/README.md index 7597dc8..36e4d86 100644 --- a/tests/README.md +++ b/tests/README.md @@ -6,26 +6,28 @@ Tests for verifying Kubernetes manifest generation produces expected output. ```bash # Run all tests -docker run --rm -v $(pwd):/workspace -w /workspace \ +docker run --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/workspace -w /workspace \ shopsys/kubernetes-buildpack:2.0 \ ./tests/run-tests.sh # Run specific scenario -docker run --rm -v $(pwd):/workspace -w /workspace \ +docker run --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/workspace -w /workspace \ shopsys/kubernetes-buildpack:2.0 \ ./tests/run-tests.sh basic-production # Update expected files after intentional changes -docker run --rm -v $(pwd):/workspace -w /workspace \ +docker run --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/workspace -w /workspace \ shopsys/kubernetes-buildpack:2.0 \ ./tests/run-tests.sh --update # List available scenarios -docker run --rm -v $(pwd):/workspace -w /workspace \ +docker run --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/workspace -w /workspace \ shopsys/kubernetes-buildpack:2.0 \ ./tests/run-tests.sh --list ``` +Using `--user "$(id -u):$(id -g)"` ensures generated files are owned by your local user instead of `root`. + ## Options ``` diff --git a/tests/scenarios/basic-production/expected/webserver.yaml b/tests/scenarios/basic-production/expected/webserver.yaml index 95665fa..20ae8e1 100644 --- a/tests/scenarios/basic-production/expected/webserver.yaml +++ b/tests/scenarios/basic-production/expected/webserver.yaml @@ -300,6 +300,9 @@ data: fastcgi_pass php-upstream; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root/imageResizer.php; + fastcgi_param HTTPS $http_x_forwarded_proto; + fastcgi_param HTTP_HOST $request_host; + fastcgi_param REQUEST_SCHEME $http_x_forwarded_proto; } # plain 404 page for missing files accessed via CDN diff --git a/tests/scenarios/development-single-domain/expected/webserver.yaml b/tests/scenarios/development-single-domain/expected/webserver.yaml index f73fbf4..296414f 100644 --- a/tests/scenarios/development-single-domain/expected/webserver.yaml +++ b/tests/scenarios/development-single-domain/expected/webserver.yaml @@ -298,6 +298,9 @@ data: fastcgi_pass php-upstream; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root/imageResizer.php; + fastcgi_param HTTPS $http_x_forwarded_proto; + fastcgi_param HTTP_HOST $request_host; + fastcgi_param REQUEST_SCHEME $http_x_forwarded_proto; } # plain 404 page for missing files accessed via CDN diff --git a/tests/scenarios/escaping-env/expected/webserver.yaml b/tests/scenarios/escaping-env/expected/webserver.yaml index 7bec260..dde511d 100644 --- a/tests/scenarios/escaping-env/expected/webserver.yaml +++ b/tests/scenarios/escaping-env/expected/webserver.yaml @@ -300,6 +300,9 @@ data: fastcgi_pass php-upstream; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root/imageResizer.php; + fastcgi_param HTTPS $http_x_forwarded_proto; + fastcgi_param HTTP_HOST $request_host; + fastcgi_param REQUEST_SCHEME $http_x_forwarded_proto; } # plain 404 page for missing files accessed via CDN diff --git a/tests/scenarios/production-with-cloudflare/expected/webserver.yaml b/tests/scenarios/production-with-cloudflare/expected/webserver.yaml index 9d92adf..2878fd2 100644 --- a/tests/scenarios/production-with-cloudflare/expected/webserver.yaml +++ b/tests/scenarios/production-with-cloudflare/expected/webserver.yaml @@ -300,6 +300,9 @@ data: fastcgi_pass php-upstream; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $realpath_root/imageResizer.php; + fastcgi_param HTTPS $http_x_forwarded_proto; + fastcgi_param HTTP_HOST $request_host; + fastcgi_param REQUEST_SCHEME $http_x_forwarded_proto; } # plain 404 page for missing files accessed via CDN