Unable to create Stash trigger in JIRA when using Nginx

Still need help?

The Atlassian Community is here for you.

Ask the community

 

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

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.

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.

Resolution

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

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

Restart JIRA.

Last modified on Feb 26, 2016

Was this helpful?

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