Proxy Jira 7 Over https with Nginx

I run self-hosted atlassian products and wanted to serve Jira, Stash, and Fisheye on the same server over https.

Users would connect securely to Nginx, and Nginx would proxy Jira locally over standard http. I'm using AWS and the security group (firewall) has all incoming ports locked down except ports 80 and 443.

Java configs & AJAX requests ended up making this a little more complicated than anticipated so I thought I would document the details.

The Goal

Serve the apps at the following addresses:

For this article, I'm only going into detail with Jira.

Nginx Config

This is my virtual host config for Jira.

Notice that the proxy_pass is set to the domain name. Typically something like this would be, however I ran into some issues with Jira making AJAX requests.

I resolved this by making a local host record (/etc/hosts) of, then using the domain name in the proxy_pass value. I didn't want to mess with firewall settings but if you know of an approach that doesn't depend on a host record, let me know!

server {
  listen 80;
  listen 443 ssl;

  ssl on;
  error_page 497  https://$host$request_uri;
  ssl_certificate  /path/to/ssl/;
  ssl_certificate_key /path/to/ssl/;

  location /jira {
    client_max_body_size 10M;
    proxy_set_header Host $host;
    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;

Jira Config

The file to configure in Jira is [jira directory]/conf/server.xml.

Here is the relevant xml configuration that is part of that file:

    <Service name="Catalina">
        <Connector port="8082"
                   scheme="https" proxyName="" proxyPort="443" secure="true"/>


        <Engine name="Catalina" defaultHost="localhost">
            <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
                <Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

Once that these files are configured, simply restarting Jira and Nginx should work.