Unable to Preview Office Documents After Upgrading to Confluence 5.7.x Because of NGINX Cache Configuration

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.

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

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.

Resolution

Add the following configuration in NGINX cache configuration:

...
       set $do_not_cache        0;
       if ($request_uri ~* ^(/secure/admin|/plugins|/rest).*) {
                set $do_not_cache       1;
       }
       proxy_cache_bypass       $do_not_cache;
...

Last modified on Feb 26, 2016

Was this helpful?

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