Skip to content

Conversation

Copy link

Copilot AI commented Nov 25, 2025

What problem does this PR solve?

Addresses feedback from #1682 (discussion): nginx was being reloaded every 12 hours regardless of whether certificates were actually renewed, causing unnecessary reloads.

How did you fix the problem?

Use certbot's --deploy-hook option which only executes when a certificate is successfully renewed:

certbot renew --deploy-hook "
  NGINX_ID=\$(docker ps -q -f 'name=nginx' | head -1)
  if [ -n \"\$NGINX_ID\" ]; then
    docker exec \"\$NGINX_ID\" nginx -s reload
  fi
"
  • Nginx reload now only triggers on actual certificate renewal
  • Eliminates ~730 unnecessary nginx reloads per year (2 per day × 365)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 25, 2025
Copilot AI and others added 2 commits November 25, 2025 04:20
…renewed

Co-authored-by: Nishim12 <140373368+Nishim12@users.noreply.github.com>
Co-authored-by: Nishim12 <140373368+Nishim12@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on new deployment strategy PR Use certbot --deploy-hook to reload nginx only on certificate renewal Nov 25, 2025
Copilot AI requested a review from Nishim12 November 25, 2025 04:22
Base automatically changed from new-deployment-strategy to develop November 28, 2025 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants