Unable to create Stash trigger in JIRA when using Nginx

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

JIRA is behind an Nginx reverse-proxy and linked to Stash. All JIRA/Stash linked functionality works except for Stash related trigger creation (commit, branch, pull request, or review) when editing a workflow in JIRA.

Prior to clicking the 'Add trigger' button, the below Diagnostics pop-up window reports an error stating that Stash is not able to communicate with JIRA.

(Auto-migrated image: description temporarily unavailable)

Diagnosis

Environment

  • JIRA behind Nginx reverse-proxy

  • Stash linked to JIRA

  • All JIRA/Stash application link functionality works except for trigger creation

Cause

Stash has an application link cache that assumes there are two "Cache-Control" headers present: "max-age" and "stale-while-revalidate". These header values control the cache and when absent, cause the cache to never load the data required for Stash to connect to JIRA. Due to the Nginx configuration, these header values are being overwritten preventing Stash to connect to JIRA.

Solution

Resolution

Explicitly set the ”max-age" & "stale-while-revalidate" headers in the Nginx configuration. Make sure "proxy_hide_header Cache-Control;” is not set.

1 add_header Cache-Control "no-transform, max-age=600, stale-if-error=86400, stale-while-revalidate=86400";

Restart JIRA.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.