Skip to content

Add per-host gzip, asset cache TTL, and HTTP/3 controls - #5803

Closed
RentnerKev wants to merge 6 commits into
NginxProxyManager:developfrom
RentnerKev:rentner/proxy-host-performance-http3
Closed

Add per-host gzip, asset cache TTL, and HTTP/3 controls#5803
RentnerKev wants to merge 6 commits into
NginxProxyManager:developfrom
RentnerKev:rentner/proxy-host-performance-http3

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Aug 25, 2026

Copy link
Copy Markdown

Why

Issue #5448 requests first-class UI controls for gzip compression and configurable asset cache lifetimes.

Currently, gzip settings and custom cache durations require manual directives in the Advanced configuration field. This is less convenient, error-prone, and difficult to manage consistently across Proxy Hosts.

This PR adds these settings directly to the Proxy Host UI and also adds independent HTTP/2 and HTTP/3/QUIC controls. HTTP/1.1 remains available as the default fallback.

The API changes are additive and backward compatible:

  • no existing fields or endpoints are removed or renamed
  • existing Proxy Hosts retain the previous gzip behavior
  • the default asset cache lifetime remains 30 minutes
  • HTTP/3 is disabled by default

Closes #5448
Closes #1550
Closes #2834

Related to #5690: this PR also serializes Nginx configuration lifecycle
operations and adds safeguards against stale host configurations being recreated.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • API changes
  • Performance improvement
  • Test addition or update

AI Usage

  • AI was used to write this
  • AI was used to review this

What Changed

Gzip compression

  • Added a per-Proxy-Host gzip toggle
  • Added compression levels from 1 to 9
  • Added selection of additional MIME types
  • Explicitly generates gzip off when disabled
  • Preserves the previous gzip behavior for existing hosts

Asset caching

  • Added a configurable cache lifetime per Proxy Host
  • Only displays the cache lifetime field when asset caching is enabled
  • Applies the configured lifetime to regular and custom locations
  • Keeps the existing 30-minute value as the default

HTTP protocols

  • Added independent HTTP/2 and HTTP/3 controls
  • HTTP/1.1 remains available as a fallback
  • Requires a certificate before HTTP/3 can be enabled
  • Added QUIC listener and Alt-Svc handling
  • Added support for NPM_PUBLIC_HTTPS_PORT
  • Added UDP 443 conflict detection for Streams
  • Added protection against conflicting manual QUIC listeners
  • Added locking for concurrent UDP 443 allocations

Configuration safety

  • Serialized Nginx configuration lifecycle operations
  • Prevented stale host configurations from being recreated
  • Added automatic synchronization of the shared HTTP/3 listener
  • Added database migrations, OpenAPI schemas and translations

Backward Compatibility

All new database fields have defaults matching the existing behavior. Existing API clients can continue operating without sending the new fields.

HTTP/3 remains opt-in and does not create a QUIC listener unless at least one eligible Proxy Host enables it.

Testing

The following checks passed:

  • Backend unit tests
  • Frontend component tests
  • Backend and frontend linting
  • OpenAPI schema validation
  • Frontend production build
  • Production Docker image build
  • Fresh SQLite migration test
  • Cypress API and UDP conflict tests
  • Nginx configuration validation with nginx -t

Deployment Note

HTTP/3 requires the HTTPS port to be available through both TCP and UDP. Docker and firewall configurations must therefore allow:

  • 443/tcp
  • 443/udp

When a different external HTTPS port is used, NPM_PUBLIC_HTTPS_PORT should be configured so the generated Alt-Svc header advertises the correct port.

Related Work

I am aware that #5587 also implements HTTP/3 support. This implementation additionally includes per-host protocol controls, persistent UDP 443 allocation, Stream conflict detection, manual QUIC listener detection, public port handling, and serialized Nginx configuration lifecycle operations.

If preferred by the maintainers, the HTTP/3 portion can be separated so that the gzip and cache lifetime changes remain focused on #5448.

@RentnerKev RentnerKev changed the title Rentner/proxy host performance http3 Add per-host gzip, asset cache TTL, and HTTP/3 controls Aug 25, 2026
@nginxproxymanagerci

Copy link
Copy Markdown

Docker Image for build 5 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-5803

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

@Alexis-Loskoutoff

Copy link
Copy Markdown
Collaborator

Thanks for your PR and for taking the time to contribute!

To make the review process easier, I’d recommend splitting this into several smaller, more focused PRs — at least one for Gzip, one for asset caching, and one for HTTP/3.

Keeping each PR focused on a single topic will make the changes much easier to understand, review, test, and discuss.

Thanks again for your contribution

@RentnerKev

Copy link
Copy Markdown
Author

Thanks for the feedback. I have split this into three separate PRs, each targeting develop independently:

Each PR includes its own migration, API/UI changes, and focused tests. The branches were validated individually and together in a temporary integration checkout; details and test limitations are documented in each PR.

I am closing this combined PR in favor of those three focused PRs. The original branch and discussion remain available for reference.

@RentnerKev RentnerKev closed this Aug 30, 2026
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.

Gzip / Cache Lifetime Support HTTP/3 HTTP3 + QUIC support

2 participants