After setting up Nginx to proxy to JIRA, none of my assets (CSS, JS or images) load

This question is in reference to Atlassian Documentation: Integrating JIRA with Nginx

I set up the Nginx proxy as described here.

When I go to JIRA, anything at <base url>/s/ seems not to load. Most of the application's assets like CSS, JS and images seem to be found at this path.

Accessing JIRA directly, bypassing the proxy, works fine.

If I follow the URL of the assets (for example using the Networks tab of Chrome's debugging tools), I see a JIRA 404 page, rather than nginx.

My configurations:

&lt;Connector port="8080"
                   maxThreads="150"
                   minSpareThreads="25"
                   connectionTimeout="20000"
                   enableLookups="false"
                   maxHttpHeaderSize="8192"
                   protocol="HTTP/1.1"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   acceptCount="100"
                   disableUploadTimeout="true"
                   proxyName="&lt;domain&gt;"
                   proxyPort="80"/&gt;
server {
    listen &lt;domain&gt;:80;
    server_name &lt;domain&gt;;
    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://localhost:8080/jira/;
        client_max_body_size 10M;
    }
}

Where <domain> is the domain at which I wish to access JIRA

5 answers

1 accepted

This widget could not be displayed.

I checked out my access logs for JIRA, located at /opt/atlassian/jira/logs/ which showed me requests similar to "GET /jira//s/d41d8cd98f00b204e9800998ecf8427e-CDN/[...]" - there is an extra slash by /jira//

So double-checking my nginx and JIRA config shows the only trailing slash - in the nginx config.

Changing proxy_pass http://localhost:8080/jira/ to proxy_pass http://localhost:8080/jira fixed it for me.

Steven Behnke Community Champion Sep 16, 2016

Whoo! Thanks for providing your solution! I've definitely done that before myself. >_<

Yeah, I think I had found some results that were similar but not exactly like my resolution. In particular, there is an Atlassian documentation that specifies how to fix that extra slash on the JIRA Tomcat server, but not if it's coming from nginx. Anyway, thought it might be useful!

This widget could not be displayed.

I had this issue as well, but checking the configuration file I forgot to comment the followind lines:

 

 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php7.0-fpm:
# fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#}

 and

#location = /favicon.ico { log_not_found off; access_log off; }
#location = /robots.txt { log_not_found off; access_log off; allow all; }
#location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
# expires max;
# log_not_found off;
#}

After that it stared to work

Roboo I'm New Here Aug 05, 2018

Thanks Simon, this fixed my issue :)

This widget could not be displayed.
Steven Behnke Community Champion Sep 16, 2016

Can you share your configuration details?

This widget could not be displayed.

Updated the question with config details

This widget could not be displayed.

For me changing the proxy_pass directive did not solve the issue.

Here's my nginx.conf

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://192.168.0.110:8081/jira;
                client_max_body_size 10M;

            }

 

and the error I get when accessing: http://192.168.0.110/jira/secure/Dashboard.jspa

 

http://192.168.0.110/s/26affc4f16c905f5f1f17026cd70afa4-CDN/3pc49q/73012/b6b48b2829824b869586ac216d119363/36bdaebd89070ad4ecdd9b63c8a47c95/_/download/contextbatch/css/_super/batch.css

not found.

 

However, I think it's a nginx config issue, but I don't manage to solve it.

 

Do you also have Wordpress installed?

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

175 views 2 0
Join discussion

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