Serving Redmine under a sub-URI

Hosting Redmine at a path such as /redmine works, but only when the relative URL root is set consistently across assets, the proxy and the application. This page explains the settings, the failure points and what to confirm before go-live.

On this page

Serving Redmine under a sub-URI: when a path beats a dedicated hostname

Choose a sub-URI when Redmine must sit beside other internal tools on one hostname and you control the reverse proxy that routes them. A path such as /redmine lets one certificate, one DNS name and one login page front several applications, which suits teams that already publish their internal tools under a single company host. The trade-off is that Redmine has to know its own public path. Every URL it generates, including links in notification emails, redirects after login and references to stylesheets and scripts, must include that prefix, or the browser will request addresses that the proxy does not route to Redmine.

What changes in the request path is simple to state but easy to get wrong. The proxy strips or preserves the prefix, Puma receives the request under the path Redmine expects, and Rails builds links from its configured relative URL root. Assets are the step most often missed. Because static files are compiled during production setup, the relative URL root must be set during asset precompilation through the RAILS_RELATIVE_URL_ROOT environment variable, so that stylesheet and image paths carry the prefix. Changing the path after precompiling means assets have to be built again. Confirm the exact behavior of your chosen installation method against the Redmine installation guide before you fix the path.

A dedicated hostname is usually simpler to operate. It avoids prefix handling in plugins, which may build links or load resources on their own, and it keeps any future move to another host or version upgrade free of path settings. Ask your team whether any plugin on your list has been tested under a sub-URI, and whether your identity and email settings reference the public address. If the answer to either is unclear, a hostname is the lower-risk choice.

Sub-URI options and when each fits

This table compares the three ways to publish Redmine: its own hostname, a path prefix handled entirely by the reverse proxy, and a path prefix that the application itself knows about. Read each row against your proxy, container image and plugin list, because the right option depends on those, not on preference.

OptionWhat it asks forWhen it fits
Dedicated hostnameDNS record, TLS certificate and a proxy server block for the Redmine host; no path settings in RedmineGreenfield installs, or when other apps already occupy the root and a subdomain is acceptable
Path prefix, proxy-onlyProxy strips the prefix before forwarding; Redmine serves from /, so generated links point to the wrong pathQuick pilots only; links, redirects and asset URLs often break in email and emails sent from the app
Path prefix with RAILS_RELATIVE_URL_ROOTSame prefix set in the app environment and in the asset precompile step, plus matching proxy rulesShared hostnames that must keep /redmine, when your proxy and plugins are tested under the prefix
Container image behaviorConfirm how the official image reads the relative root variable and whether precompiled assets are rebuilt at startContainers need the prefix at build or first boot; a rebuild with a different prefix can leave stale assets
Plugin compatibilityCheck each plugin for hard-coded root paths, JavaScript URLs and asset helpers before enabling the prefixPlugins with absolute paths usually force the proxy-only or dedicated hostname option
Email link correctnessSet the public URL and host used in notification links to include the prefixRequired in every prefix option; test a notification link after each change
Upgrade effortRe-test the prefix, asset build and plugin pages after each Redmine minor or major upgradeDedicated hostnames carry the least upgrade retesting; prefixes add a short regression checklist
Proxy ownershipConfirm who controls the shared proxy and whether path rewrites are allowed by its change processPath prefixes suit teams that share one edge proxy with other applications

How to configure a sub-URI for Redmine step by step

This sequence moves a Redmine instance from its own hostname to a path such as /redmine, so that assets, links, attachments and sign-in all resolve under the prefix. Each step ends with a check you can run before users see the change.

  1. Choose the path and the public address

    Decide the public URL users will type, for example and write down the path segment, the host and the protocol. The path must be identical in the proxy, the application and any links you publish, so settle it before editing any configuration. Confirm with the team that owns DNS and the TLS certificate that the hostname and certificate cover this address. The output is a short written record of the path, host and scheme that every later step will reuse.

  2. Set RAILS_RELATIVE_URL_ROOT before asset precompilation

    Set the environment variable RAILS_RELATIVE_URL_ROOT to the path, such as /redmine, in the environment where Redmine runs and where its assets are built. Do this before precompiling assets, because Rails writes the prefix into stylesheet and script URLs at that time. Keep the value the same for the application server, background workers and any rake task you run. The check is that the variable is visible in each of those processes, for example by printing it from the same shell or container that starts Redmine.

  3. Rebuild or reprecompile the assets

    Run the asset precompilation again with the variable set, or rebuild the container image if you run Redmine in Docker. Precompiled assets generated without the prefix will keep requesting files from the root path, so reusing an older build is the most common cause of unstyled pages. Clear any previously compiled assets in the public directory before running the build so no stale files remain. The check is that the compiled stylesheet references include the prefix when you inspect the generated files.

  4. Configure the reverse proxy prefix handling

    Configure the reverse proxy so that requests under the path reach Redmine in the form the application expects. Decide whether the proxy strips the prefix before forwarding or passes it through unchanged, and match that choice to how Redmine was started. Set forwarding headers for the original host, scheme and client address, and check that the proxy forwards requests to static files under the same prefix. Confirm the exact behavior against the Redmine installation guide and the documentation for your proxy, because the two sides must agree. The check is that a request to the prefix root returns the Redmine login page rather than a 404.

  5. Set host and protocol for generated links

    Set the host name and protocol that Redmine uses when it builds absolute URLs, including the link in notification email, the API responses and the links in exported content. Redmine's email and host settings live in its configuration, so confirm the host, port and scheme values there match the public address from the first step. If TLS terminates at the proxy, make sure Redmine is told the original scheme is https so that links are not generated as http. The check is that a test notification email contains a link that starts with the public address and includes the path prefix.

  6. Restart all Redmine processes

    Restart the application server, every background worker and the proxy so that they all load the new environment and configuration together. A process that was not restarted can keep serving old prefix values and produce mixed links on the same site. In a container setup, recreate the containers rather than only restarting them if the image or environment changed. The output is a clean start with no errors about missing assets or unknown routes in the logs.

  7. Verify the login page, stylesheet and attachment links

    Open the login page under the prefix in a private browser window and confirm it loads with its styling and images. Then sign in, open a project, and follow a link to an attachment and to a stylesheet or script URL, checking that each request stays under the prefix and returns a success status. Upload a small test file to an issue and download it through the link in the page to confirm attachment paths resolve. Record the results and repeat the check for any plugin pages you use, since plugins may build their own URLs. The sequence is complete when all of these checks pass on the public address.

Which links, assets and plugins break when the root is wrong

The most visible failure is an unstyled page. Redmine's stylesheets and JavaScript are built for the path it was compiled to expect. If RAILS_RELATIVE_URL_ROOT was not set when assets were precompiled, or was set to a different value than the proxy path, the browser requests /assets/... at the host root, gets a 404 or the wrong file, and the page loads without styling or menus. Check this first by loading the site and reviewing the browser's network log for asset requests that miss the prefix. Confirm the exact precompile steps and variables for your installation method in the installation guide before changing anything, because the fix usually means recompiling rather than editing the proxy alone.

The second group of failures is links and redirects that drop the prefix. Redmine builds many URLs from its configured root, but a reverse proxy that strips /redmine before forwarding, or a Location header rewritten incorrectly, sends users to /projects or /login at the host root. Login loops, redirects to a different application, and broken links in the wiki or issue history often trace back to this mismatch between the public path, the proxy rules and the application's root setting. Test sign-in, logout, a project page, an attachment download and an API call through the prefix, not only the home page.

Email notification links are the failure that goes unnoticed longest, because nothing on the web page looks wrong. Notification bodies carry absolute links built from the configured host and path, so a missing or incorrect root sends people to a URL that does not resolve. Send a test notification after any change, and confirm the same applies to API callbacks and any outgoing webhooks, whose target URLs and the links they return must include the prefix. Plugins need separate attention: a plugin with hard-coded paths, its own asset pipeline or absolute URLs can work at the root and fail under /redmine. Ask each plugin's maintainer how it handles relative URLs, test every plugin under the prefix before any Redmine upgrade, and record the results so the upgrade test has a baseline.

Sub-URI setup by deployment model

On a Linux host, Redmine reads RAILS_RELATIVE_URL_ROOT from the environment of the process that runs Puma, and Nginx owns the public path. Set the variable in the systemd unit that starts Puma, then compile assets with the same value so the stylesheet and script paths carry the prefix. The Puma service and the Nginx configuration are covered in the sibling topic on running Redmine with Puma behind Nginx.

  • Relative URL root in the service unit: set RAILS_RELATIVE_URL_ROOT=/redmine in the environment of the Puma service so Rails generates every internal link with the prefix.
  • Asset precompilation with the same value: run assets:precompile with the variable set in the same shell, and repeat it after any change to the prefix, because compiled asset paths depend on it.
  • Nginx location block: the location for the prefix forwards to Puma and passes the original host and protocol headers, and its trailing slash handling must match what Redmine generates.
  • Static files under the prefix: Nginx must serve or proxy the public files under the same path, or stylesheets and images will return 404 errors.

After a restart, confirm that login redirects, issue links, attachment downloads and the link inside a notification email all open under the prefix.

Security considerations for a path-based Redmine

Serving Redmine under a path shares its hostname and proxy with other applications, so the cookie, header and routing decisions you make affect more than Redmine. The cards below cover the risks that change when Redmine lives at a prefix such as /redmine, and the control to check for each one.

Session cookie path and scope

Redmine's session cookie is set for the path it is served under, but other applications on the same hostname can set cookies that Redmine will also receive. Check which path and domain attributes the session cookie carries, and confirm that no sibling application sets a cookie with the same name on a broader path. Ask the application owners which cookie names they use before you go live. Test sign-in and sign-out from each sibling application, because a cookie collision often appears as an unexpected logout rather than as a visible error.

TLS termination and HTTPS detection

When the reverse proxy terminates TLS, Redmine receives plain HTTP from the proxy and must be told the original scheme. If it is not, generated links, redirects and secure cookie flags can be wrong. Confirm that the proxy sends the forwarded protocol header that your Redmine configuration reads, and that the Rails setting for forced SSL matches your public URL. Test a login over HTTPS and check the Set-Cookie response headers for the Secure attribute.

Trusted proxy configuration

Redmine uses forwarded headers such as the client address to make decisions, including logging and some access checks. If it trusts forwarded headers from any address, a client can send its own values directly. Restrict trusted proxies to the address range of your reverse proxy or load balancer, and make sure the proxy overwrites rather than appends client-supplied forwarding headers. Confirm the setting in the application logs by checking the recorded client address for a test request.

Shared hostname with other applications

A path-based Redmine often sits beside wikis, dashboards or internal tools on one hostname. Any of those applications can read or write content that a browser sends to the shared origin, and a script running in one can reach cookies or local storage used by another. List every application on the hostname and decide whether each one needs its own hostname. Where separation is not possible, document the trust relationship and review the other applications' security settings as part of the same change.

Narrow proxy location rules

A prefix rule that is too broad can expose paths the Redmine application never meant to publish, such as administrative tools or internal endpoints of another service on the same server. Define one location block for the Redmine prefix, include the exact path for static assets, and deny everything else by default. Test a set of unrelated paths, including a path that only differs by a trailing slash, and confirm they return the response of the correct application or a refusal.

Redirects and absolute URL generation

Redmine builds absolute links for notifications, API responses and redirects. If the configured root path or host does not match the proxy, a redirect may send users to an address outside the prefix or to an internal host name. Check that the public host and prefix are set once in the configuration, and that a login redirect and an email notification link both point to the public address. Confirm this before sharing the URL with users, since a wrong link can also leak an internal address into email.

Questions teams ask before serving Redmine under a path

Can we serve Redmine under a path without outside help?

Yes, if your team already runs Rails applications behind a reverse proxy and can rebuild assets after a configuration change. The work is small in code terms but unforgiving in detail: the path must be set during asset precompilation, the proxy must forward the prefix correctly, and every generated link must agree with it. Teams without a Rails background usually find the asset step and the email links the hardest parts. A partner is worth considering when the path has to match an existing portal, when several applications share one hostname, or when your team has no one to test the result after each upgrade. Confirm your team's Rails and proxy experience before deciding.

What makes a sub-URI deployment harder or easier?

The effort is driven by three factors:

  • Plugins: each installed plugin must be checked for hard-coded root paths, and some may need patches or replacement.
  • Proxy complexity: a single location block that strips and forwards a prefix is simple, while shared hosts with several applications, sticky sessions or custom headers add testing.
  • Container versus host: with the official Docker image, the variable is set at build or start time and tested inside the image. On a Puma and Nginx host, you control the Gemfile.local, the precompile step and the systemd unit directly.

Installed plugin count and proxy rules usually set the scope, so inventory both before estimating.

What does our team need to provide for the work?

Plan for four inputs before work starts:

  • Access to the reverse proxy or load balancer configuration that will serve the path.
  • DNS control or a decision on which hostname will front the path.
  • A test copy of Redmine with a copy of the database and uploaded files, so path changes can be checked without touching production.
  • A named owner who approves URL changes and can confirm that email links, API clients and bookmarks work after cutover.

Ask any provider to list these inputs in the written scope, since missing access is a common reason for delays.

How long does a sub-URI setup take?

Duration depends on scope rather than on the path itself. A single instance with no custom plugins, behind a proxy your team already manages, is the shortest case. Duration grows with the number of plugins that need checking, the number of applications sharing the proxy, and the time needed to approve a test copy and a cutover window. No duration is set here because none has been researched for this work. Ask for a timeline in the written scope that separates the test copy, the proxy change, plugin checks and the post-cutover verification.

Does serving Redmine under a path raise the cost of upgrades?

It can, because every upgrade must reproduce the path setting and re-run asset precompilation with the same value. The official upgrade guide describes backing up the database and uploaded files, copying configuration, uploads and third-party plugins to the new installation, then running the database and plugin migrations before clearing the cache and restarting. A path adds a check after each of those steps: confirm that assets load, links resolve under the prefix and plugins still render. Teams that keep a documented path setting and a scripted test pass usually find upgrades routine. Read the Redmine upgrade guide before planning the first upgrade.

When is a dedicated hostname simpler than a path?

A dedicated hostname is simpler when Redmine is the only application under its address, when you want to avoid rebuilding assets for a path, or when plugins or themes make prefix handling hard to verify. It also reduces the chance of links breaking when other applications change their paths. A path makes sense when a portal or intranet already owns the hostname and users expect one address. Choose the path only when that integration need is clear, and document the reason so future administrators do not reverse it without testing.

What breaks first when the sub-URI setting is wrong?

Asset requests usually fail first, so pages load without styles or scripts. Next come email links, which point to the wrong address and send users to a broken page, and then redirects and API responses that carry the root path. Plugins with hard-coded paths can fail quietly on individual pages. Check a sample of pages after every change, test one notification email, and confirm that the API responds under the prefix. Keep the path setting in version control so a rebuild cannot drop it silently.

Does a path setting affect security or access controls?

The path itself does not change Redmine's role-based access control, but the proxy in front of it does. Confirm that the proxy enforces TLS, forwards only the headers Redmine expects and does not expose the application under a second path by accident. Review the Redmine installation guide for the production settings that apply to your host. Ask the implementation provider to include a configuration review and a retest of login, API access and file downloads under the new prefix in the written scope.

How a request reaches Redmine under a path prefix

The request starts at the browser and reaches the reverse proxy, which terminates TLS and is the trust boundary where the path prefix is matched. The proxy forwards the path and headers to Puma or the container, and Redmine builds every link and asset URL from its relative URL root. Email links and API responses take the same configured base URL, so check all three paths after any change, not only the login page.

Requests cross the proxy boundary, and Redmine uses the configured root for links, emails and API paths.

How to verify a sub-URI deployment before users arrive

Treat the sub-URI setup as unproven until a fixed set of checks passes under the real prefix, such as /redmine, through the same proxy and TLS path users will use. Test login and logout first, because the session cookie path, the redirect target after sign-in and the sign-out URL are all built from the prefix. Then load the main pages and confirm that stylesheets, JavaScript and images return without 404 errors in the browser developer tools or the proxy access log. A page that renders with missing styles usually means RAILS_RELATIVE_URL_ROOT or the asset build did not match the prefix, which is faster to find here than after go-live.

Next, exercise the paths that carry the prefix into other systems. Upload an attachment to an issue, then download it from a second browser session, and check that the link resolves under the prefix and the file arrives intact. Trigger a notification by changing an issue, and open the link from the email on a machine outside your office network, because links that point at the internal hostname or drop the prefix only show up there. Make one REST API call with a user's API key, using the X-Redmine-API-Key header, to confirm that the API routes are reachable under the prefix. Finally, open a page from every installed plugin, since plugins often hard-code paths or assets that a prefix change breaks.

Repeat this full pass after every Redmine or plugin upgrade and after any change to the proxy rules, because a new release or plugin version can alter asset paths or routes without any visible error. Record the results in a short checklist so the next operator can rerun the same pass. Confirm the exact upgrade steps and any prefix-related settings for your Redmine version in the Redmine upgrade guide and with each plugin's maintainer.

How DeployOpen scopes and delivers a Redmine sub-URI deployment

DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside your own infrastructure, including Redmine. For a sub-URI deployment, we start by confirming the path, proxy layout and email and plugin dependencies, then build and test the setup in your environment and hand over the configuration and runbook your team needs to operate it.

How we scope

  • Confirm the public path, such as /redmine, and the hostname, TLS termination and proxy stack in use.
  • Inventory plugins, email links, API clients and bookmarks that depend on the current root URL.
  • Agree the written scope, deliverables and timeline before any work starts, with each item named.

How we build

  • Set RAILS_RELATIVE_URL_ROOT consistently for asset precompilation and runtime in your chosen deployment method.
  • Write and test proxy rules so static assets, attachments and API paths resolve under the sub-URI.
  • Verify outgoing email links, redirects, plugin pages and the REST API against the sub-URI before sign-off.

How we hand over

  • Document the final configuration, proxy snippets and environment variables, with the reasons behind each setting.
  • Provide a checklist for future upgrades, plugin updates and changes to the public path.
  • Walk your operations and security teams through the setup and the verification results.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer once the deployment is live.
  • Retest proxy and URL behavior after Redmine upgrades, plugin changes or changes to the reverse proxy.
  • Ask for a quote that separates one-time implementation work from recurring support and maintenance.

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.