hide server tokens

This commit is contained in:
Asharas 2021-03-07 17:14:25 +01:00 committed by Adrian Nöthlich
parent 76057146a6
commit 00e89ec449
2 changed files with 6 additions and 2 deletions

View file

@ -33,8 +33,9 @@ RUN set -x \
# Copy nginx conf from official image # Copy nginx conf from official image
COPY --from=nginx:latest /etc/nginx /etc/nginx COPY --from=nginx:latest /etc/nginx /etc/nginx
# Debian uses www-data user instead of nginx # Change nginx and disable server tokens
RUN sed -i 's@\(^user\).*[^;]@\1 www-data@' /etc/nginx/nginx.conf RUN sed -i -e 's@\(^user\).*[^;]@\1 www-data@' \
-e "/default_type/a \\ server_tokens off;" /etc/nginx/nginx.conf
# Copy cryptpad with installed modules # Copy cryptpad with installed modules
COPY --from=build --chown=cryptpad /cryptpad /cryptpad COPY --from=build --chown=cryptpad /cryptpad /cryptpad

View file

@ -34,6 +34,9 @@ RUN set -x \
# Copy nginx conf from official image # Copy nginx conf from official image
COPY --from=nginx:latest /etc/nginx /etc/nginx COPY --from=nginx:latest /etc/nginx /etc/nginx
# Disable server tokens
RUN sed -i "/default_type/a \\ server_tokens off;" /etc/nginx/nginx.conf
# Copy cryptpad with installed modules # Copy cryptpad with installed modules
COPY --from=build --chown=cryptpad /cryptpad /cryptpad COPY --from=build --chown=cryptpad /cryptpad /cryptpad