This commit is contained in:
Vladimir Melnik 2022-12-01 18:42:41 +01:00 committed by GitHub
commit 201cbe9531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View File

@ -65,7 +65,7 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
COPY --from=dockergen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
COPY network_internal.conf /etc/nginx/
COPY network_internal.conf maintenance_internal.conf /etc/nginx/
COPY app nginx.tmpl LICENSE /app/
WORKDIR /app/

View File

@ -62,7 +62,7 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
COPY --from=dockergen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
COPY network_internal.conf /etc/nginx/
COPY network_internal.conf maintenance_internal.conf /etc/nginx/
COPY app nginx.tmpl LICENSE /app/
WORKDIR /app/

View File

@ -0,0 +1,8 @@
error_page 503 @maintenance;
recursive_error_pages on;
location @maintenance {
error_page 405 = /index.html;
add_header Cache-Control no-cache;
root /usr/share/nginx/html/maintenance;
rewrite ^(.*)$ /index.html break;
}

View File

@ -231,6 +231,9 @@ server {
listen [::]:{{ $external_http_port }};
{{ end }}
{{ $access_log }}
{{ if (exists "/usr/share/nginx/html/maintenance/index.html") }}
include /etc/nginx/maintenance_internal.conf;
{{ end }}
return 503;
}
@ -243,6 +246,9 @@ server {
listen [::]:{{ $external_https_port }} ssl http2;
{{ end }}
{{ $access_log }}
{{ if (exists "/usr/share/nginx/html/maintenance/index.html") }}
include /etc/nginx/maintenance_internal.conf;
{{ end }}
return 503;
ssl_session_cache shared:SSL:50m;