Reverse Proxy with Nginx

 I'm trying to setup a reverse proxy so that I can access jira through

On the dashboard the gadgets don't load and I see a banner that says.

"I have added those line exactly (leaving $host as is) in the location / { section.

I restarted nginx, I can't restart jira. When I go to the page I see the gadgets are not visable and I have a banner that reads "JIRA's base URL is set to but you are accessing JIRA from"


nginx conf

server {
    #to allow large uploads (eg: for restoring backups)...
    client_max_body_size 100M;
    location / {
        proxy_pass http://localhost:8080;


<Service name="Catalina">

        <Connector port="8080"




JIRA will not start.

sudo service jira start

If I view the dashboard the widgets say "Unable to connect"

In the logs I see "Detected URL hostname, 'localhost', does not match expected hostname ''

Where does the 'localhost' come from?

2 answers

1 vote

Hi Cody, 

Try adding the following headers to your nginx connector config and see if it helps. 


        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

I added it and restarted nginx but no change.

0 vote

Hi Cody, 


There's some JIRA docs that could help you on this matter. For example, if you take a look at this article you will see that the cause could be related to the Apache server not identifying the current host to be redirected. Also, I could find some related Answers posts that could be kindly related to your situations. Some suggesting to add a ProxyPreserveHost On in the Apache Virtual host and others related to make the proxy reverse value to be "off".


These examples came from the following answers:


Hope it helps you, sir!




Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

354 views 6 8
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot