As given in the warning message, Nginx GPP key in not valid as it expired. You need to fetch new GPG key from the Nginx website.
Here are the steps to fix this warning message:
- Run the following command on the terminal to download the new Nginx GPG Key and add it to your keyring:
curl -fsSL https ://nginx.org/keys/nginx_signing.key | sudo gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg
- Run the following command on the terminal to modify the Nginx repository configuration to use the new key:
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https ://nginx.org/packages/mainline/debian/ bookworm nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
- Refresh the package list using the following command to use the new Nginx GPG key:
apt update
There is a space between "https" and ":", remove the space before using these commands.