Jira instance behind nginx - few resources still using localhost

Mubin Ahmed November 5, 2017

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 votes
Eduard M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 6, 2017

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?

Mubin Ahmed November 8, 2017

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?

Eduard M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 9, 2017

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