Setting Jira with nginx

Valeriy Orlov January 7, 2012

We have installed apache (as back-end) with ngnix (as front-end). The site opened, but not displayed style. How to adjust the jira with nginx?

7 answers

1 vote
FinalX August 17, 2012

I had the same problem, and after an hour of searching around, I finally figured it out; I had changed the username nginx ran as, and nginx had already made some directories on the filesystem to store the cached proxy files in.

Do a chown over the dir that holds the proxied content, like, for example on Debian 6.0:

chown -R newuser /var/lib/nginx/proxy/*

I actually had the problem with Confluence, but I'm sure it's the same for anything proxied.

Another issue I had with JIRA was the dashboard being pretty empty, try adding this in that case (given that you've set it to BLOCK elsewhere):

add_header  X-Frame-Options ALLOW;

JIRA (and only JIRA of the products I use) needs this.

0 votes
Anatoly Mikhaylov February 3, 2014

We have optimised Jira through Nginx as reverse-proxy by using few things: Nio enabled, gzip disabled on Tomcat, but enabled on Reverse proxy side, Proxy with HTTP 1.1 keep-alive, SSL offload, multiplexing SPDY https://gist.github.com/mikhailov/8562320

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2012
0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2012

Right, so the problem is not Jira. You may have more luck asking nginx users, as the problem is with that.

Valeriy Orlov January 7, 2012

where I can find them :D waiting for the Jamie...

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2012

The base url is not that important yet - you can set it when you get Jira running.

Your Tomcat looks fine to me, so you really do need to check that Jira is running by logging on to the server and using a Browser to try localhost:8080 (or wget if there's no GUI to support a browser). If that gets you something, then you know Jira is running and you need to fix nginx settings. If it's not running there, then have a look at the application log (in fact, you should do that anyway, because Jira's startup will echo the current url to get to it into the log)

Valeriy Orlov January 7, 2012

before that I used apache, and everything worked fine. after installing nginx (now apache + nginx) problems began. I understand that the problem in nginx, but I am a newbie and I can not understand the source of problem.

Valeriy Orlov January 7, 2012

now in apache conf:

<VirtualHost *:85>
ServerAdmin mail
ServerName domen
DirectoryIndex index.html index.php
DocumentRoot path
AddDefaultCharset utf-8
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ErrorLog /var/log/apache2/proj-error_log
CustomLog /var/log/apache2/proj-access_log common
</VirtualHost>

Valeriy Orlov January 7, 2012

nginx works at 80 and apache in 85

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2012

If the proxyPort and proxyHost set correctly in the Connector element in your server.xml (in tomcat)?

Is the base URL set correctly?

What URLs is the browser attempting to get for the .css files?

Valeriy Orlov January 7, 2012

Im my server.xml:

<Service name="Catalina">

<Connector port="8080"

maxThreads="150"
minSpareThreads="25"
maxSpareThreads="75"
connectionTimeout="20000"

scheme="http"
proxyName="projects.dhwc.info"
proxyPort="80"

enableLookups="false"
maxHttpHeaderSize="8192"
protocol="HTTP/1.1"
useBodyEncodingForURI="true"
redirectPort="8443"
acceptCount="100"
disableUploadTimeout="true"/>

My links:

http://clip2net.com/s/1t0dr

Were is base url?

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2012

I think this is about your nginx configuration, not Jira.

Jira will be listening/publishing on whatever url and port you've configured it for (I can't tell you what the defaults for that are because you've not told us how you've deployed it - standalone, war, etc, and I think the defaults may vary slightly between versions)

"The site opened, but not displayed style" implies to me that nginx is running ok, but you've not configured it to relay/forward the Jira site. You'll need to consult the nginx docs to find out how to get it to serve up Jira.

Valeriy Orlov January 7, 2012

Now my config:

server {
listen 80;
server_name my domen;

access_log /var/log/nginx/jira_access.log;
error_log /var/log/nginx/jira_error.log;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
port_in_redirect off;
proxy_redirect http://127.0.0.1:8080/ /;
proxy_connect_timeout 300;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}

}

but it still not working...

Suggest an answer

Log in or Sign up to answer