Unable to create Stash trigger in JIRA when using Nginx
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
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.
- JIRA behind Nginx reverse-proxy
- Stash linked to JIRA
- All JIRA/Stash application link functionality works except for trigger creation
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.
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";