Running Orthanc behind nginx, Apache or IIS

Placing Orthanc's REST API and viewers behind a reverse proxy adds TLS termination, path routing and upload limits, and it is the expected pattern for any Orthanc exposed beyond localhost.

On this page

Why teams put Orthanc behind a reverse proxy with nginx, Apache or IIS

A hospital or imaging team that needs browser and API access to Orthanc from other networks, or under a single shared hostname, usually places a reverse proxy in front of it. The proxy is the component that accepts requests from clients and forwards them to Orthanc, which by default listens for HTTP on port 8042. Orthanc only accepts HTTP connections from localhost out of the box, so anything beyond the server itself needs a deliberate change in how traffic reaches it. Nginx, Apache and IIS are the three web servers the Orthanc Book walks through for this pattern, with the nginx and Apache guides covering the most detail.

The proxy gives the team several controls at one point of entry. It terminates TLS, so browsers and API clients connect over HTTPS while Orthanc receives the forwarded traffic. It maps paths under one domain, for example serving Orthanc under a prefix such as /orthanc/ alongside other applications. It enforces upload limits, which matters because DICOM files can be large and web servers apply small defaults to request bodies. It can also apply access controls at the edge, such as allow lists or additional authentication, before a request reaches Orthanc. None of these replaces Orthanc's own settings. Confirm with your security team which of these controls they require at the proxy and which they expect Orthanc to enforce.

The Orthanc security FAQ recommends HTTPS and a reverse proxy when Orthanc is exposed to the Internet. It also sets a condition on remote access: if RemoteAccessAllowed is enabled, AuthenticationEnabled should be true, with users defined in RegisteredUsers. Treat the proxy as one layer, not the only one. Before opening any route, verify that authentication is active on the Orthanc side, that the proxy forwards only the paths you intend to publish, and that the sensitive routes described in the security FAQ, such as /tools/execute-script and the export route, are disabled. The Orthanc Book security FAQ lists these settings and is the reference to check against your configuration.

Choosing nginx, Apache or IIS for an Orthanc front end

This table compares nginx, Apache and IIS as the proxy in front of Orthanc's REST API and viewers. Read each row against your team's existing skills and standards. The main takeaway is that the Orthanc Book documents nginx and Apache examples, while IIS needs confirmation from your Windows administrators before you commit to it.

FactornginxApacheIIS
Fit with existing stackOften chosen where Linux web operations already exist. Confirm your team runs it in production.Suits teams already maintaining Apache httpd for other applications. Confirm module availability on your build.Suits Windows-first shops with existing IIS administration. Confirm with your Windows administrators.
Documented Orthanc exampleThe Orthanc Book nginx FAQ shows Orthanc on port 8042 under /orthanc/.The Orthanc Book Apache FAQ describes the setup, including upload limits.No supplied source covers IIS configuration. Treat any IIS setup as unverified until tested.
Upload size settingclient_max_body_size, which defaults to 1 MB and must be raised for large DICOM uploads.LimitRequestBody, which must be raised for large DICOM uploads.Request filtering limits must be set and tested with real DICOM files. Confirm the exact setting with your administrators.
TLS terminationTerminates HTTPS at the proxy. Certificate handling and renewal are set in the server block.Terminates HTTPS at the proxy. Certificate handling depends on the modules and build you install.Terminates HTTPS through site bindings and certificate stores. Confirm certificate renewal ownership.
Operations ownershipOwned by the team that runs Linux servers and logs for the hospital network.Owned by the team that maintains Apache configuration and patching.Owned by the Windows team, with patching and logs managed through Windows tooling.
Verification effortTest large uploads, viewer loading and the /orthanc/ path after every config change.Test the same paths and upload limits, plus module load order after updates.Test the same paths and limits on the Windows host, including the Orthanc service behind it.

How a browser request reaches Orthanc through the proxy

A request starts in the user's browser or API client and travels over HTTPS to the reverse proxy, which terminates TLS, enforces the upload size limit and rewrites the path under /orthanc/. The proxy then forwards plain HTTP to Orthanc on port 8042 on localhost or a private interface. Orthanc's own check, either RegisteredUsers or the advanced authorization plugin, is the second trust boundary, so teams should confirm that nothing reaches Orthanc except through the proxy.

Trust boundaries between the client, the proxy and the Orthanc host.

Setting up the proxy in order

This sequence takes Orthanc from a local-only service to a reverse-proxied endpoint that accepts large uploads over TLS, with each step confirmed before the next one starts. Work it in order, because a failed upload test is much easier to diagnose when the earlier layers are already verified.

  1. Confirm Orthanc listens on port 8042

    Start from the Orthanc configuration file and check the HTTP port, which is 8042 in the Orthanc Book's nginx example. Check RemoteAccessAllowed and AuthenticationEnabled as well. By default Orthanc only accepts HTTP connections from localhost, so the proxy on the same host can reach it while remote clients cannot. If you enable remote access, AuthenticationEnabled should be true with users defined in RegisteredUsers before the proxy is exposed. Verification: a request to the local system information route on port 8042 returns a response, and an unauthenticated request is rejected when authentication is on.

  2. Create the proxy site under a path prefix

    Create a site in nginx, Apache or IIS that forwards a path such as /orthanc/ to the Orthanc listener. Decide whether the proxy strips the prefix before forwarding, since Orthanc generates its own links and redirects, and the viewer and Orthanc Explorer 2 base URLs must match what the proxy publishes. The nginx and Apache examples in the Orthanc Book show the forwarding pattern to copy and adapt. Verification: a GET request through the proxy path returns the same JSON from the system route as the direct local request.

  3. Raise the upload size limit

    Increase the request body limit on the proxy before testing uploads. In nginx, the default client_max_body_size is 1 MB, which rejects most DICOM files, so set it to a value that covers your largest expected instance, as the Orthanc Book advises. In Apache, set LimitRequestBody for the proxied location. For IIS, check the request filtering maximum allowed content length in the site configuration. Confirm the exact directive and unit with the current documentation for your server version. Verification: the configuration test command reports no errors, and the service reloads cleanly.

  4. Enable TLS on the proxy

    Terminate HTTPS at the proxy with a certificate issued by your internal or public certificate authority, and redirect plain HTTP requests on the public name to the HTTPS endpoint. The Orthanc security FAQ recommends HTTPS and a reverse proxy for Internet exposure, so keep the proxy as the only listener reachable from outside the host. Decide whether traffic from the proxy to Orthanc stays on localhost or also uses TLS, and document that choice for your security review. Verification: a TLS scan or browser check shows a valid certificate chain for the published name, and the plain HTTP request does not return Orthanc content.

  5. Align base URLs for Orthanc Explorer 2 and viewers

    Set the public path and host in the viewer and Orthanc Explorer 2 configuration so that their asset requests, API calls and redirects resolve through the proxy path rather than to localhost or port 8042. Mismatched base URLs usually show as a blank page, missing scripts or login redirects that point to the internal address. Check each viewer you publish separately, since each plugin has its own settings. Verification: the Explorer 2 page loads its scripts and styles through the proxy URL, and browser developer tools show no requests to the internal address or port.

  6. Test a large DICOM upload through the proxy

    Upload a DICOM file close to the largest size your site expects, using the REST API or the viewer, through the public HTTPS path. Use a file above 1 MB so the test actually exercises the raised limit, and keep a note of its size. If the upload fails with an HTTP 413 response or a connection reset, the size limit has not taken effect in the layer that rejected it. Verification: the instance appears in the Orthanc study list, and the stored file can be retrieved through the API with the same byte size.

  7. Test API and viewer access end to end

    Run a final round of checks as a registered user and as an unauthenticated client. Confirm that authenticated API calls succeed through the proxy, that the viewer opens a study, and that requests without valid credentials are refused. Review the proxy access and error logs for unexpected paths, since a mistake in path rewriting often appears there first. If you use the advanced authorization plugin, confirm that denied requests return HTTP 403 as documented. Verification: each check is recorded with its result, and the proxy logs show no unexplained errors for the test session.

Upload size limits for large DICOM files

A default proxy body limit can reject a DICOM upload before it ever reaches Orthanc, and the failure often looks like an Orthanc problem. The cards below cover where each limit lives, how the limits must agree across the chain, and how to prove the setup with the study sizes your modalities and users actually produce.

Raise the nginx body limit

nginx rejects request bodies above client_max_body_size, which defaults to 1 MB. The Orthanc Book's nginx example advises raising this value so larger DICOM files can be uploaded through the proxy. Set it in the server or location block that forwards to Orthanc on port 8042, then reload nginx and confirm the new value is active in the running configuration.

Orthanc nginx guide

Set LimitRequestBody in Apache

Apache enforces a request body ceiling through LimitRequestBody, which the Orthanc Book's Apache guide mentions for large uploads. Apply it in the virtual host or directory context that proxies to Orthanc, and check whether any Location or Directory block overrides the server-wide value. A mismatch between contexts is a common cause of uploads that succeed for small studies and fail for large ones.

Orthanc Apache guide

Match limits across the whole chain

Limits apply at every hop: an external load balancer, a web application firewall, a TLS terminator and the proxy itself can each reject a body. Ask the network or cloud team to list every component between the modality or browser and Orthanc, and set the same ceiling at each one. A proxy that accepts 2 GB while the load balancer stops at a smaller value still fails the upload, and the error may appear only at the outer layer.

Check timeouts with the limit

A higher body limit only helps if the upload can finish before a timeout fires. Large studies take longer to transfer, so review proxy read and send timeouts and any load balancer idle timeout together with the size limit. Confirm that long uploads through the viewer and through direct API calls both complete, because the two clients often use different request patterns.

Test with real study sizes

Assumed sizes hide failures. Take representative studies from your modalities, such as multi-frame CT or MR series and whole-slide pathology files, measure their on-disk size, and upload the largest ones through the full proxy path. Record which layer returns the error, since an HTTP 413 response usually comes from the proxy while an Orthanc rejection has a different source. Repeat the test after every proxy or load balancer change.

Limit uploads to trusted clients

Raising the body limit for everyone also lets any authenticated or unauthenticated caller send very large requests. Keep the higher ceiling on the route used for DICOM uploads, and apply a lower default elsewhere. Pair the change with Orthanc authentication, since Orthanc only accepts remote HTTP connections when RemoteAccessAllowed is enabled and then recommends AuthenticationEnabled with RegisteredUsers defined.

TLS termination and path rewriting trade-offs

In this model, clients connect to the reverse proxy over HTTPS, the proxy holds the public certificate and private key, and it forwards plain HTTP to Orthanc on port 8042 on a private network. This is the common pattern in the Orthanc Book's nginx and Apache guidance, and it keeps certificate renewal in one place rather than on every Orthanc node.

  • Certificate location: The certificate and key live on the proxy. Orthanc itself does not need a public certificate for browser traffic.
  • Backend exposure: Orthanc should only accept connections from the proxy host or a private subnet. The default localhost-only binding must be changed deliberately, and RemoteAccessAllowed should only be enabled with AuthenticationEnabled set to true and users defined in RegisteredUsers.
  • Forwarded headers: Configure the proxy to pass the original host and protocol so links and redirects in Orthanc Explorer 2 and other viewers point to the public address.
  • Scope of the proxy: TLS on the proxy does not encrypt the hop between the proxy and Orthanc, so that hop must sit on a network you control.
  • DICOM TLS is separate: Encrypting the REST API at the proxy does nothing for DICOM C-STORE or C-FIND traffic. Orthanc supports DICOM TLS for inter-site exchanges from version 1.9.0, and it must be configured on the DICOM side.

Confirm with your security team whether the internal hop is an acceptable trust boundary for patient data.

Security controls at the proxy and in Orthanc

A reverse proxy only protects Orthanc if the Orthanc side is locked down too. The cards below cover the Orthanc settings and routes that matter once the REST API and viewers are reachable beyond localhost, and the proxy-level checks that keep them enforced.

Keep script and export routes disabled

The Orthanc security FAQ warns that the /tools/execute-script route can let a malicious user run any system command, and that the export route can overwrite files. Both should stay disabled in any deployment behind a proxy. Confirm this on the running instance by testing the routes from the proxy's public address, not only from the server itself, because a proxy rule that forwards all paths can expose them even when the server config is correct.

Orthanc security FAQ

Enforce authentication for remote access

By default Orthanc accepts HTTP connections only from localhost. When RemoteAccessAllowed is enabled, set AuthenticationEnabled to true and define users in RegisteredUsers. Without this, anyone who reaches the proxy can read patient studies. Check that the proxy does not inject credentials or bypass the Orthanc login for any path.

Use HTTPS on every public path

The Orthanc security FAQ recommends HTTPS and a reverse proxy for Internet exposure. Terminate TLS at the proxy for the REST API, Orthanc Explorer 2 and any web viewer, and redirect plain HTTP to HTTPS. Check every location block, including health checks and static viewer assets, because one unencrypted path can expose session credentials or image data.

Restrict proxy access by network

Limit which clients can reach the proxy before authentication is applied. Allow-lists for hospital subnets, VPN ranges or known viewer hosts reduce the attack surface of the login page itself. Confirm the allow-list in the proxy config, and test from a network outside the allowed range to confirm the request is refused.

Decide per-request access with an authorization plugin

The advanced authorization plugin forwards each REST request's token to an external web service that decides access and returns HTTP 403 when denied. This is useful when access depends on the user, the study or the requested action, rather than a single login. The reference project uses Keycloak-issued tokens with Orthanc Explorer 2. Plan the decision service, its availability and its logging before adoption, because every request depends on it.

Authorization plugin docs

Confirm proxy headers and upload limits

Check that the proxy passes the correct forwarded headers so Orthanc logs and any authorization decisions see the real client address and scheme. Confirm that the body size limit is set for large DICOM uploads without being left unlimited on routes that do not need it. Verify the configuration after each change to the proxy or Orthanc version.

Questions buyers ask before running Orthanc behind a proxy

How much effort does a reverse proxy setup in front of Orthanc take?

The effort depends mostly on proxy experience, the number of viewers and clients that reach Orthanc, the authentication model, and how certificates are managed. A single nginx or Apache site serving the REST API and one viewer is a contained task for an engineer who already runs web proxies. Effort grows when several viewers need different path prefixes, when SSO or an authorization service sits in front of the API, or when the team must rotate certificates across several hostnames. The Orthanc Book's nginx and Apache guides cover the basic proxy pattern, so the main variables are your environment and your review process, not the proxy syntax itself.

  • Proxy skills in the team
  • Number of viewers and API clients
  • Authentication model and token handling
  • Certificate issuance, renewal and storage
Can an internal team set up Orthanc behind a proxy without outside help?

Yes, a team with web server administration skills can usually do the proxy work alone, using the official nginx and Apache guides in the Orthanc Book as the starting point. The harder parts are usually outside the proxy: firewall rules, TLS policy, network ownership, and testing with real study sizes. Orthanc is licensed for use without a paid edition, so the software itself carries no license fee. Outside help is most useful when the team lacks proxy or security review experience, when the change must pass a formal change board, or when the viewers and authorization model need to be designed together.

What does the work need from our team before it starts?

Plan to provide four inputs before the proxy configuration is written. First, certificates for the public or internal hostname, along with the private key handling rules your security team requires. Second, a test dataset that reflects your real study sizes, because upload limits are often the first thing that fails with large DICOM files. Third, written ownership of the network path from the proxy to the Orthanc host, including firewall changes and any load balancer. Fourth, the list of viewers and API clients that will connect, with the paths they use. Your security team should also confirm whether the REST API is reachable only from inside the hospital network or from the Internet.

What deployment services does Orthanc Team SRL sell, and how is pricing set?

Orthanc Team SRL, the company that maintains the Orthanc core, sells deployment, configuration and development services, and it also sells pre-paid dedicated support hours that are valid for 12 months. Pricing is quoted on request, so there is no published rate to compare against. When you ask for a quote, request a written scope that lists the proxy configuration, the viewers covered, the testing you expect, and any support hours included. Orthanc itself has no paid edition, so the cost is for services and support, not for the software. DeployOpen is a separate company and quotes its own work from a written scope.

How do upload size limits affect large DICOM files behind a proxy?

The proxy rejects uploads larger than its own body size limit before the request ever reaches Orthanc. The Orthanc Book notes that nginx's default limit is 1 MB and advises raising client_max_body_size so larger DICOM files can be uploaded, and the Apache guide similarly points to LimitRequestBody. Set the limit from your own largest expected study rather than a guessed number, and test the upload with a file of that size through the full path, including any load balancer or cloud gateway in front of the proxy. Check that timeouts are long enough for the upload to finish, because a limit that passes can still fail on a slow connection.

What security settings should we check before exposing Orthanc through a proxy?

Confirm that remote access is intentional before it is enabled. By default Orthanc only accepts HTTP connections from localhost, and the Orthanc security FAQ says that if RemoteAccessAllowed is enabled, AuthenticationEnabled should be true with users defined in RegisteredUsers. The same FAQ recommends HTTPS and a reverse proxy for Internet exposure. Also confirm that the /tools/execute-script route and the export route are disabled, because the FAQ warns that the first can run system commands and the second can overwrite files. Finally, check that TLS terminates at the proxy with a current protocol policy and that proxy logs do not capture credentials.

What should we verify before the proxy goes live?

Run a short checklist against a staging copy before cutover. Test an upload of your largest study through the full path, confirm that the viewer loads studies and images, and confirm that an unauthenticated request is refused when remote access is enabled. Check the certificate chain in a browser and from the command line, verify the path prefix works for every viewer, and confirm that the firewall allows only the intended source networks. Record the proxy and Orthanc versions, store the configuration in version control, and agree on a rollback step with the operations team. Confirm the Orthanc version you run against the release notes, since the 1.13.0 release on 2026-08-15 changed storage-area access and DICOM parsing.

Which costs recur after the proxy is live?

The proxy itself is usually free software, so recurring costs come from people and infrastructure. Plan for certificate renewal, patching of nginx or Apache, review of the Orthanc release notes when a new version ships, and monitoring of proxy logs and error rates. If you use a load balancer or cloud gateway, its hourly or per-request charges and data transfer fees recur as well. Support hours from the Orthanc vendor or a partner are recurring only if you buy them, and they are quoted on request. Ask any partner to show which of these items sit in their quote and which stay with your team.

How DeployOpen scopes a reverse proxy build for Orthanc

DeployOpen plans, implements, hardens and documents the reverse proxy and Orthanc configuration inside your own infrastructure, and the scope is agreed in writing before any work starts. For a proxy build, that scope names the proxy product (nginx, Apache or IIS), the public hostnames, the path prefix Orthanc will sit under, the TLS certificate source, the upload size ceiling for DICOM files, the authentication model, and which Orthanc routes stay reachable through the proxy. Those decisions shape the configuration, so they should be made with your security and PACS teams before the build, not discovered during testing.

The work typically covers the proxy configuration itself, the matching Orthanc settings such as RemoteAccessAllowed, AuthenticationEnabled and RegisteredUsers, and the controls that keep dangerous routes closed, including /tools/execute-script and the export route. Testing covers large uploads against the configured body size limit, login and access behavior for the REST API and each viewer, and confirmation that disabled routes return errors through the proxy as well as directly. The handover includes configuration files, a test record, and a runbook for changing hostnames, certificates and limits. Confirm in the written scope which of these items, and which of your environments (test, staging, production), are included, and ask for the proxy and Orthanc versions the work will target.

Proxy builds rarely end at handover. Certificates renew, Orthanc releases change, and proxy vendors publish fixes, so many organizations add a retainer for upgrades and continuous testing after the initial build. Ask any partner, including DeployOpen, to state in the quote which items recur, how upgrades are tested against your configuration, and who holds the credentials and certificate renewal process at each stage.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.