Running NGINX reverse proxy in front of Jira (localhost) Edited

 

I've setup Jira to run on my.lan.net:8080 and now would like to add Nginx as a reverse proxy. I've made the edits following the guide here: https://confluence.atlassian.com/jirakb/integrating-jira-with-nginx-426115340.html. It seems something is amiss however. The login page is missing all CSS or something.

jira.png

 

I can't quite figure out what I've goofed up. Anyone know where to look for clues? Are all four connector configurations required for this or am I supposed to only pick one? Not sure from the docs. My intention is to run Jira on the localhost interface
only and have Nginx handle the outside-world communication stack. Perhaps this is not possible?

my nginx config is this:

server {
listen 80;
server_name my.lan.net;
return 301 https://$server_name$request_uri;
access_log off;
}

server {

listen 443 ssl;
server_name my.lan.net;

ssl_certificate /etc/nginx/ssl/bundle.crt;
ssl_certificate_key /etc/nginx/ssl/my_lan_net.key;

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://127.0.0.1:8080/jira/;
client_max_body_size 10M;
}

}

my jira/conf/server.xml is here:
<Service name="Catalina">

<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="my.lan.net"
proxyPort="80"
scheme="http"
/>

<!-- Nginx Proxy Connector -->
<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="my.lan.net" proxyPort="80"/>

<!-- OPTIONAL,Nginx Proxy Connector with https -->
<Connector port="8081" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" proxyName="my.lan.net" proxyPort="443" scheme="https" secure="true"/>

<!-- Standard HTTP Connector -->
<Connector port="8082" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true"/>

...
<Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">
...

 

1 answer

0 vote

In your server.xml you cannot have two connectors on the same port. Remove one of them.

Second, your nginx config forces users to use https. This is good, but your only needed connector is this:

<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="my.lan.net"
proxyPort="443"
scheme="https"
secure="true"
/>

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 Monday 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...

620 views 6 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