diff --git a/context/nginx/conf.d/stub.default.conf b/context/nginx/conf.d/stub.default.conf new file mode 100644 index 000000000..0f8255c46 --- /dev/null +++ b/context/nginx/conf.d/stub.default.conf @@ -0,0 +1,11 @@ +server { + server_name localhost; + listen 80; + access_log off; + + location /nginx_status { + stub_status; + allow 127.0.0.1; + deny all; + } +} diff --git a/context/nginx/conf.d/stub.default.conf.tmpl b/context/nginx/conf.d/stub.default.conf.tmpl new file mode 100644 index 000000000..0f8255c46 --- /dev/null +++ b/context/nginx/conf.d/stub.default.conf.tmpl @@ -0,0 +1,11 @@ +server { + server_name localhost; + listen 80; + access_log off; + + location /nginx_status { + stub_status; + allow 127.0.0.1; + deny all; + } +} diff --git a/generator/index.php b/generator/index.php index 554bfadc4..69216d007 100644 --- a/generator/index.php +++ b/generator/index.php @@ -505,6 +505,10 @@ static function ($endpoint) use ($projectData) { $deploymentDir . DS . 'context' . DS . 'nginx' . DS . 'conf.d' . DS . 'debug.default.conf', $twig->render('nginx/conf.d/debug.default.conf.twig', $projectData) ); +file_put_contents( + $deploymentDir . DS . 'context' . DS . 'nginx' . DS . 'stub.default.conf', + $twig->render('nginx/conf.d/stub.default.conf.twig', $projectData) +); file_put_contents( $deploymentDir . DS . 'context' . DS . 'nginx' . DS . 'entrypoint.sh', $twig->render('nginx/entrypoint.sh.twig', $projectData) diff --git a/generator/src/templates/nginx/conf.d/stub.default.conf.twig b/generator/src/templates/nginx/conf.d/stub.default.conf.twig new file mode 100644 index 000000000..0f8255c46 --- /dev/null +++ b/generator/src/templates/nginx/conf.d/stub.default.conf.twig @@ -0,0 +1,11 @@ +server { + server_name localhost; + listen 80; + access_log off; + + location /nginx_status { + stub_status; + allow 127.0.0.1; + deny all; + } +} diff --git a/images/common/frontend/Dockerfile b/images/common/frontend/Dockerfile index 1a9cab66d..22ff10786 100644 --- a/images/common/frontend/Dockerfile +++ b/images/common/frontend/Dockerfile @@ -8,6 +8,7 @@ RUN mkdir -p /etc/nginx/template/ && chmod 0777 /etc/nginx/template/ COPY --chown=root:root nginx/nginx.original.conf /etc/nginx/nginx.conf COPY --chown=root:root nginx/conf.d/frontend.default.conf.tmpl /etc/nginx/template/default.conf.tmpl COPY --chown=root:root nginx/conf.d/resolver.conf.tmpl /etc/nginx/template/resolver.conf.tmpl +COPY --chown=root:root nginx/conf.d/stub.default.conf.tmpl /etc/nginx/conf.d/stub.conf COPY --chown=root:root nginx/auth /etc/nginx/auth COPY --chown=root:root nginx/entrypoint.sh / RUN chmod +x /entrypoint.sh