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

This widget could not be displayed.

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
Community showcase
Published Apr 22, 2018 in Jira Software

How-to setup a secured Jira Software 7.9.0 on Ubuntu 16.04.4 in less than 30 minutes

...PermissionsStartOnly=true User=www-data Group=www-data ExecStart=/opt/jira/bin/startup.sh ExecStop=/opt/jira/bin/shutdown.sh TimeoutStartSec=120 TimeoutStopSec=600 PrivateTmp=true [Install] WantedBy...

1,426 views 10 12
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