diff --git a/Dockerfile b/Dockerfile index f673e63..4f077f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,9 @@ RUN mkdir /ejks \ # Runtime container FROM nginx:1.25.3-alpine-slim +# Replace default configuration +COPY nginx-default-server.conf /etc/nginx/conf.d/default.conf + # Add application COPY --from=builder /ejks /usr/share/nginx/html COPY src/favicon.ico src/googlee78c4ec223f14545.html /usr/share/nginx/html/ diff --git a/nginx-default-server.conf b/nginx-default-server.conf new file mode 100644 index 0000000..30bc874 --- /dev/null +++ b/nginx-default-server.conf @@ -0,0 +1,19 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + error_page 404 =200 /index.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +}