'localhost', does not match expected hostname with basic Caddy reverse proxy

I've managed to get Jira up on my server now, it's a vanilla installation straight from the install docs running on port 8990 and connected to a postgres db on localhost.

My reverse proxy is Caddy, it simply redirects http://jira.mydomain to http://localhost:8990 (no SSL, that looks like a nightmare to set up, one of the reasons I use Caddy is the automated SSL - but I won't bother with that right now).

I first got the baseurl error which I fixed. Now I'm getting this other error which seems like its trying to use localhost for every reletive address.

The dashboard shows the `UrlHostnameMismatchException` but I've tried to set the hostname URL via server.xml:

<Engine name="Catalina" defaultHost="jira.mydomain">
    <Host name="jira.mydomain" appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

Restarted and still the same error. How on earth do I fix this? Do I have to modify the Caddy config to do something or change the Jira config?

I'd rather not install another proxy just for Atlassian apps, Caddy does a great job for my existing services and the painless HTTPS support is great.

1 answer

1 accepted

1 vote
Accepted answer

I figured it out straight after, but maybe this will be useful. If you're a Caddy reverse-proxy user and you stumbled upon this, I hope it helps!

The solution is to add a `proxyName` and `proxyPort` attribute to the `<Connector>` object:

<Connector port="8990"


Annoyingly, this information was buried in Apache specific documentation whereas it's software-agnostic when it comes to reverse proxy applications.

I'm now going to try HTTPS with Caddy's auto-installed certs and update this response...

SSL with Caddy's auto-install was simpler than I thought!

Just add the `scheme` field alongside `proxyName`, set `proxyPort` to 443 and modify your Caddyfile to use https.


You might also want to add:


Oh yeah I forgot to mention, I was looking for documentation on that attribute but couldn't find any. What does it actually mean?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

905 views 3 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you