##duplicate server_tokens off
##remove all server_tokens
find /path/to/nginx/config/directory -type f -name "*.conf" -exec sed -i '/server_tokens off;/d' {} +
##http2 was not use anymore
### single file
sed -i 's/listen 443 ssl http2; # managed by Certbot/listen 443 ssl; # managed by Certbot\nhttp2 on;/' /path/to/test/file.conf
### batch file
find /path/to/directory -type f -name "*.conf" -exec sed -i 's/listen 443 ssl http2; # managed by Certbot/listen 443 ssl; # managed by Certbot\nhttp2 on;/' {} +
nginx
nginx command collection
One minute to read
ipang