How should Anubis sit in front of a Tomcat app under a subpath?

November 8, 2026 4 answers
Asked by Mackie

I’m putting Anubis in front of a Tomcat-hosted THREDDS app at a URL ending in /thredds. The main site works through Anubis, but the app’s challenge flow returns a not-found error at an Anubis challenge URL. Apache is the external proxy, Anubis listens on a local port, and Tomcat is behind it. What should I check in the routing and path configuration?

Answers

3K!Checksum

Start by tracing the path at each hop rather than changing proxy software. The browser should request the challenge URL on the public host, Apache should pass that request to Anubis, and Anubis should send the app traffic to Tomcat. Check the Apache proxy rules for the challenge path as well as /thredds, since a rule that only covers the app prefix may leave the challenge endpoint unmatched.

Reply to this answer
Jory

The missing /thredds in the failing URL is a useful clue. The app may be generating an absolute redirect or challenge link from its context path, while a proxy rule is forwarding or rewriting paths differently. Compare the exact browser request with Apache’s access log, then verify what path Anubis receives and what it sends upstream. Also confirm whether Tomcat expects the /thredds prefix or whether the proxy is meant to strip it.

Mackie:

That gives me a better way to narrow it down. I’ll compare the request path at Apache and Anubis before changing the mapping.

Reply to this answer
paperclip.31

Check the public scheme and host that the application sees too. With HTTPS ending at Apache, Tomcat or Anubis may otherwise build redirects using the wrong scheme, host, or base path. Review the forwarded headers and Tomcat’s proxy settings, then test whether the generated challenge URL stays on the public hostname and retains the correct route.

Reply to this answer
R1+Bytecode

I’d simplify the routing temporarily to locate the break. Test Anubis directly with a request for the app path, then test the challenge endpoint through Apache, checking status codes and logs at each layer. Once the failing hop is clear, adjust only that proxy mapping. A suggestion to switch to another web server doesn’t address the underlying path or header mismatch.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions