Jira instance behind nginx - few resources still using localhost

Hi,

I have setup Jira server with Nginx proxying. A custom subdomain is configured with forwarding to the local instance of Jira. Here is the configuration that I use in nginx:

 

server {
server_name mysubdomain.mydomain.com
location / {
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;
proxy_pass http://127.0.0.1:5555;
}
}

 

Almost everything works fine. However, there are some resources that are still loaded from 127.0.0.1 instead of the server_name, and due to that it doesn't load them. For example, below 3 resources are always pointing to 127.0.0.1:

1. projectavatar.svg

2. useravatar.svg

3. http://127.0.0.1:5555/images/icons/priorities/medium.svg

4. http://127.0.0.1:5555/images/icons/issuetypes/story.svg

5. The last step while connecting Jira to Bitbucket

Is the nginx configuration that I use missing something?

Has anybody experienced it as well?

 

Thanks,

Mubin

 

1 answer

0 vote

Hello,

The standard nginx config should specify the jira host in the proxy_pass, such as in the example from the documentation:

 

server {
    listen www.atlassian.com:80;
    server_name www.atlassian.com;
    location /jira {
        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; 
        proxy_pass http://jira-hostname:8080/jira;
        client_max_body_size 10M;
    }
}

 Can you also verify if the Tomcat's context path and connector configuration has been updated?

The Jira host in my case is installed on the same server where nginx is running, and that is why I have 

proxy_pass http://127.0.0.1:5555;

 

What is the need for updating tomcat's context path when it is running on root context?

OK, if Jira is running on a root context path. Can you check if the base Jira URL is set to the value in server_name and not the proxy_pass value? I'm thinking either the nginx proxy is not working exactly as expected, or the jira configuration is slightly wrong. It might be worth looking at the requests/responses with wireshark on the load balancer side. 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 21, 2018 in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

1,049 views 8 18
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