Running NGINX reverse proxy in front of Jira (localhost)

DFMCH Helpdesk September 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 votes
josh
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.
September 26, 2017

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