You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have nginx plus image , I installed the headers-more-nginx-module,
when I exec the container I see the module inside
I want to remove the header Server: nginx from the server response
I added load_module modules/ngx_http_headers_more_filter_module.so; to my nginx.conf
and when I add to my configuration
location ~ ^/api/entityInventory/(.*) {
more_clear_headers Server;
more_set_headers "Server: my_server";
}
I still see the header Server: nginx
I have nginx plus image , I installed the headers-more-nginx-module,
when I exec the container I see the module inside
I want to remove the header Server: nginx from the server response
I added load_module modules/ngx_http_headers_more_filter_module.so; to my nginx.conf
and when I add to my configuration
location ~ ^/api/entityInventory/(.*) {
more_clear_headers Server;
more_set_headers "Server: my_server";
}
I still see the header Server: nginx
the nginxplus dockerfile is:
FROM debian:bullseye-slim
LABEL maintainer="NGINX Docker Maintainers docker-maint@nginx.com"
ENV NGINX_VERSION 1.19
COPY ./nginx-repo.crt /etc/ssl/nginx/nginx-repo.crt
COPY ./nginx-repo.key /etc/ssl/nginx/nginx-repo.key
RUN --mount=type=secret,id=nginx-crt,dst=nginx-repo.crt
--mount=type=secret,id=nginx-key,dst=nginx-repo.key
set -x
&& addgroup --system --gid 101 nginx
&& adduser --system --disabled-login --ingroup nginx --no-create-home --home /nonexistent --gecos "nginx user" --shell /bin/false --uid 101 nginx
&& apt-get update
&& apt-get install --no-install-recommends --no-install-suggests -y
ca-certificates
gnupg1
lsb-release
&&
NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62;
NGINX_GPGKEY_PATH=/usr/share/keyrings/nginx-archive-keyring.gpg;
export GNUPGHOME="$(mktemp -d)";
found='';
for server in
hkp://keyserver.ubuntu.com:80
pgp.mit.edu
; do
echo "Fetching GPG key $NGINX_GPGKEY from $server";
gpg1 --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$NGINX_GPGKEY" && found=yes && break;
done;
test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1;
gpg1 --export "$NGINX_GPGKEY" > "$NGINX_GPGKEY_PATH" ;
rm -rf "$GNUPGHOME";
apt-get remove --purge --auto-remove -y gnupg1 && rm -rf /var/lib/apt/lists/*
&& nginxPackages="
nginx-plus
nginx-plus-module-headers-more
"
&& echo "Acquire::https::pkgs.nginx.com::Verify-Peer "true";" > /etc/apt/apt.conf.d/90nginx
&& echo "Acquire::https::pkgs.nginx.com::Verify-Host "true";" >> /etc/apt/apt.conf.d/90nginx
&& echo "Acquire::https::pkgs.nginx.com::SslCert "/etc/ssl/nginx/nginx-repo.crt";" >> /etc/apt/apt.conf.d/90nginx
&& echo "Acquire::https::pkgs.nginx.com::SslKey "/etc/ssl/nginx/nginx-repo.key";" >> /etc/apt/apt.conf.d/90nginx
&& printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://pkgs.nginx.com/plus/debian
lsb_release -cs
nginx-plus\n" > /etc/apt/sources.list.d/nginx-plus.list&& mkdir -p /etc/ssl/nginx
&& cat nginx-repo.crt > /etc/ssl/nginx/nginx-repo.crt
&& cat nginx-repo.key > /etc/ssl/nginx/nginx-repo.key
&& apt-get update
&& apt-get install --no-install-recommends --no-install-suggests -y
$nginxPackages
curl
gettext-base
&& apt-get remove --purge -y lsb-release
&& $ apt-get install nginx-plus-module-headers-more
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx-plus.list
&& rm -rf /etc/apt/apt.conf.d/90nginx /etc/ssl/nginx
&& ln -sf /dev/stdout /var/log/nginx/access.log
&& ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80
STOPSIGNAL SIGQUIT
CMD ["nginx", "-g", "daemon off;"]
The text was updated successfully, but these errors were encountered: