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

uwdmfm I'm New Here Sep 25, 2017

 

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,203 views 13 19
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot