Chapter 17Lesson 03175–235 min

TLS, Reverse Proxies, Context Paths, HTTP Settings, Network Boundaries, and Secure Exposure: Configuration, Design Choices, and Tradeoffs

Choose deliberately among TLS termination and re-encryption, host and path routing, public package and private administration planes, custom context paths, connector strategies, and certificate automation.

ArchitectureRoutingCertificatesConnectorsTradeoffs

Learning objectives

  • Compare TLS termination with end-to-end TLS or re-encryption.
  • Choose one hostname, per-format hosts, paths, or connectors based on client behavior.
  • Decide whether administration and package traffic should share an exposure plane.
  • Evaluate custom context-path compatibility and certificate rotation approaches.
  • Use an observable decision table rather than assuming one topology fits every format.

1. Architecture is a set of explicit choices

The Chapter 17 lab used one host, TLS termination, a root context, and one Raw repository. Production introduces more dimensions: where TLS ends, how many hostnames are exposed, whether package and administration traffic share a plane, whether clients tolerate a context path, how registry routes are expressed, and who owns certificate rotation.

Version baseline (26 August 2026). The official Sonatype download and archive pages list Nexus Repository 3.95.0, build 3.95.0-07, as the current self-hosted download. Nexus Repository 3.87+ uses Java 21 and official installers include a bundled Java 21 runtime. Record the version actually running in your lab before applying any example.

2. TLS at the edge versus end-to-end TLS

Pattern External leg Backend leg Use when Main tradeoff
Edge termination HTTPS HTTP on loopback/private segment Single host or tightly controlled private network Simpler certificate ownership; backend leg is not encrypted.
TLS re-encryption HTTPS HTTPS Policy requires encryption across network segments More certificates/trust and failure points to operate.
Direct Nexus TLS HTTPS to Nexus Jetty No separate edge Small/specialized deployment where direct TLS is intentionally managed in Nexus Certificate and connector lifecycle couples to Nexus runtime.

Sonatype supports serving HTTPS directly but recommends reverse-proxy SSL management as a common production approach. The correct choice is driven by network trust boundaries and operational ownership, not by a belief that two TLS layers are automatically “more secure.”

3. One hostname versus per-format hostnames

A single name such as repo.example.invalid simplifies certificates, DNS, and developer onboarding. Per-format names such as maven.repo.example.invalid or containers.repo.example.invalid can make traffic policy and client configuration clearer, but enlarge DNS/certificate/routing state.

Decision One hostname Per-format hostnames
Certificate scope One SAN/wildcard strategy More SANs/certificates or automated wildcard policy
Reverse-proxy policy Routes distinguish by path/port Virtual hosts can isolate policy
Client UX Fewer names to remember Format intent is visible in hostname
Blast radius Edge mistake may affect many formats Misroute can be isolated to one virtual host
Observability Need path-aware metrics Hostname naturally segments traffic

4. Paths, ports, and subdomains are client-protocol choices

Most repository formats work naturally through Nexus repository paths. OCI/Docker needs special treatment because registry clients expect a /v2/ API and specific authentication challenges. Current OCI configuration supports path-based routing in all deployments, port routing on self-hosted deployments, and subdomain routing only with Pro entitlement.

Port connectors are valid but each consumes server resources and introduces firewall/listener management. Sonatype recommends limiting Docker port connectors and prefers reverse-proxy SSL management. Do not create a new connector for every repository simply because it was historically common.

5. Package plane versus administration plane

Developers and CI need repository endpoints; repository administrators need the UI and security/administrative APIs. Those audiences do not automatically need the same network exposure. A production edge can expose package paths broadly to an authenticated workforce or build network while permitting administration only from a VPN, bastion, privileged subnet, or dedicated internal hostname.

Separate audience without separate Nexus state
flowchart LR
DEV[Developers / CI] --> PUB[Package edge policy]
ADM[Administrators] --> VPN[Private admin edge]
PUB --> N[Nexus private listener]
VPN --> N
N --> DB[(Database)]
N --> BS[(Blob stores)]

The two edge paths converge on one Nexus authorization model, database, and blob store. Network segmentation narrows who can reach an interface; Nexus roles/privileges still decide what an authenticated principal can do.

6. Root path versus custom context path

A root context (/) has the lowest client compatibility risk. A custom context such as /nexus can fit shared-domain conventions, but it becomes part of every UI, REST, webhook, package, and SSO URL. Current Sonatype docs explicitly require setting nexus-context-path in Nexus and forwarding the same context path for SSO.

Upgrade note. Sonatype documents a custom-context-path regression in 3.92.0 that was fixed in 3.92.1. This is exactly why a context path should be treated as version-sensitive runtime behavior and covered by pre-upgrade smoke tests.

7. Certificate automation versus manual rotation

Manual renewal can be acceptable for a short-lived local lab. Production certificates should have an owner, expiration monitoring, a renewal mechanism, deployment automation, and a rollback plan. The safe rotation sequence is issue new certificate → validate SAN/chain/key match → deploy at one edge → perform TLS and package-client smoke tests → roll out → remove the old certificate only after successful validation.

Do not treat “certificate successfully installed” as sufficient. A client can reject the certificate because of trust-chain, SAN, SNI, expiration, clock, or endpoint mismatch even when the proxy process starts normally.

8. Base URL, context path, and forwarded headers solve different problems

Control Question it answers Does not answer
Listener host/port Where does Nexus accept backend connections? What public name clients use.
Context path Under which application prefix does Nexus run? Which TLS certificate clients trust.
Forwarded headers What scheme/host/client identity did the edge receive? Whether repository privileges allow an asset.
Base URL capability What canonical external URL should Nexus use in applicable generated URL contexts? How packets reach Nexus or which interface it binds.
Reverse proxy How external routes/TLS map to the backend? What Nexus repository path semantics mean.

9. Worked scenario: 120 developers, CI, containers, private administrators

Assume Maven/npm/PyPI clients, one OCI group, internet-facing remote workers over corporate access, and five repository administrators. The team wants minimal certificates and no direct backend exposure.

Requirement Selected approach Observable reason
General packages repo.example.invalid on 443 with repository paths One TLS edge and simple client configuration.
OCI Path-based OCI routing first Current Nexus supports it broadly; avoids per-repository connector ports.
Admin UI/API Private access policy on the same edge or dedicated internal admin hostname Positive package test from normal client plus admin denial from unprivileged network.
Backend Private interface reachable only from edge Direct 8081 probe from client network fails while edge probe succeeds.
TLS Terminate at edge; re-encrypt only if network policy requires Certificate checks are concentrated at an owned boundary.
Context Root context Lowest compatibility burden across mixed clients.
Certificates Automated organizational CA/ACME flow Expiration monitoring and repeatable renewal.

10. Keep adjacent systems in their own ownership domains

  • Nexus owns repository configuration, runtime listener/context, roles, capabilities, and repository data.
  • The reverse proxy owns edge certificates, external listeners, forwarded headers, request-size/time-out policy, and routing.
  • DNS and firewalls own name resolution and network reachability.
  • Package managers own client trust, local cache, registry/feed URL, and credentials.
  • Identity providers and CI systems own their own sessions/tokens/secrets; Nexus consumes the resulting authentication path.

11. Knowledge check

When is TLS re-encryption justified?

Why is root context usually the lowest-risk choice?

Is OCI subdomain routing mandatory for Community?

Does a private admin hostname replace Nexus RBAC?

What should certificate rotation prove before cutover?

12. Summary and next step

A production network topology is a tradeoff among client compatibility, certificate ownership, network trust, operational complexity, and recoverability. Lesson 4 turns those tradeoffs into a diagnostic method so transport failures are not misdiagnosed as repository or credential problems.

Official references and version notes

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0 Send only Ethereum/ERC-20 compatible assets to this address.