How to set up NGINX Plus as the load balancer for a JIRA Data Center cluster

Still need help?

The Atlassian Community is here for you.

Ask the community

The content on this page relates to platforms which are not supported for JIRA Applications. Consequently, Atlassian cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.

This configuration only works with NGINX Plus, the paid version of NGINX. The free version does not support cookie-based session-affinity.


JIRA Data Center needs a load balancer to run in front of it to distribute the incoming requests between each node. The load balancer must support cookie-based session-affinity. NGINX Plus can be set up to provide this for JIRA Data Center, using a configuration similar to the one below. You still need to follow the full installation guide available at Installing JIRA Data Center. For more details on the configuration of a load balancer in NGINX Plus, see the page Application Load Balancing with NGINX Plus and the Upstream module documentation, on the NGINX website.

Sample NGINX Configuration

The load balancer configuration below was taken directly from NGINX's documentation Application Load Balancing with NGINX Plus.

pid /var/run/;

events {}

http {
    # Search the cookie named JSESSIONID for data after the final ‘.’, and store that 
    # in a variable named $route_cookie
    map $cookie_jsessionid $route_cookie {
        ~.+\.(?P<route>\w+)$ $route;

    # Search the URL for a trailing jsessionid parameter, and store the value after the final ‘.’ 
    # in a variable named $route_uri
    map $request_uri $route_uri {
        ~jsessionid=.+\.(?P<route>\w+)$ $route;

    upstream jiracluster {
        server route=node1;
        server route=node2;
        sticky route $route_cookie $route_uri;

    server {
        listen 80;
        server_name MyCompanyServer;
        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_pass http://jiracluster;

        error_log /var/log/nginx/error.log;
        access_log /var/log/nginx/access.log;
Last modified on Feb 19, 2016

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.