Unable to Preview Office Documents After Upgrading to Confluence 5.7.x Because of NGINX Cache Configuration
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
After upgrading to Confluence 5.7.x, user is unable to preview Office Documents (.docx, .xlsx, .pptx) attached in the page.
Diagnosis
Environment
Confluence is running behind NGINX Proxy
Diagnostic Steps
Try attaching new Office Documents file and preview it. This should work, otherwise this article may not be applicable.
Try to preview the Office Documents in all browser to see if it's browser related issue.
Compare the properties of problematic attachment and working attachment. If the properties are different, then this article may not be applicable.
Cause
The new File Previewer is will be looking for content cache to display the Office Documents. In this case, NGINX Proxy doesn't allow caching.
Solution
Resolution
Add the following configuration in NGINX cache configuration:
1
2
3
4
5
6
7
...
set $do_not_cache 0;
if ($request_uri ~* ^(/secure/admin|/plugins|/rest).*) {
set $do_not_cache 1;
}
proxy_cache_bypass $do_not_cache;
...
Was this helpful?