Skip to content

Conversation

@mrrobot47
Copy link
Member

Summary

Fixes recurring Nginx warning logs related to duplicate http2 directives and improves handling of SSL stapling for certificates without OCSP support.

Fixes

  • Fix http2 warnings: Resolves nginx: [warn] protocol options redefined by ensuring http2 on; appears only once per server block (moved outside listen directives).
  • Fix ssl_stapling warnings: Resolves nginx: [warn] "ssl_stapling" ignored for certificates lacking OCSP responders.

Changes

  • Updated nginx.tmpl:
    • Moved http2 on; to a valid location for modern Nginx (1.25.1+), preventing duplication across IPv4/IPv6 listen blocks.
    • Added logic to respect SSL_STAPLING environment variable.
  • Updated README.md:
    • Documented new SSL_STAPLING environment variable.

Configuration

New Environment Variable:

  • SSL_STAPLING: Controls OCSP stapling. Default is on.
    • Set SSL_STAPLING=off to disable stapling and silence warnings for self-signed certs or certs without OCSP.

- Fix 'protocol options redefined' warning by placing http2 directive
  once per server block instead of after each listen directive
- Add SSL_STAPLING env var (default: on) to control OCSP stapling
- Set SSL_STAPLING=off to suppress 'ssl_stapling ignored' warnings
  for certificates without OCSP responder URLs
- Update README with SSL_STAPLING documentation
Copilot AI review requested due to automatic review settings January 12, 2026 15:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes nginx warning logs by correcting the placement of the http2 directive and adding optional control for SSL stapling via environment variable.

Changes:

  • Moved http2 on; directive outside of listen blocks to prevent duplication warnings in nginx 1.25.1+
  • Added SSL_STAPLING environment variable to allow disabling OCSP stapling for certificates without OCSP support
  • Updated documentation to include the new SSL_STAPLING variable

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
nginx-proxy/nginx.tmpl Relocated http2 on; to server-level (3 locations) and added conditional SSL stapling based on SSL_STAPLING environment variable
nginx-proxy/README.md Added documentation for the new SSL_STAPLING environment variable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant