Nginx documentation (Unofficial (Community) )

Troubleshooting

General Troubleshooting

See https://doc.owncloud.org/server/10.3/admin_manual/configuration/general_topics/general_troubleshooting.html

OAuth2 ownCloud clients cannot connect to the ownCloud server

If ownCloud clients cannot connect to your ownCloud server, check to see if PROPFIND requests receive HTTP/1.1 401 Unauthorized responses. If this is happening, more than likely your webserver configuration is stripping out the bearer authorization header.

Add the following configuration to your Nginx setup:

# Adding this allows the variable to be accessed with $_SERVER['Authorization']
fastcgi_param Authorization $http_authorization;

Problematic Web Server and PHP Modules

There are some Web server and PHP modules which are known to cause various problems like broken up-/downloads. The following shows a draft overview of these modules:

PHP

https://doc.owncloud.org/server/10.3/admin_manual/configuration/general_topics/general_troubleshooting.html#php

Nginx

  • ngx_pagespeed
  • HttpDavModule
  • X-Sendfile (causing broken downloads if not configured correctly)

JavaScript (.js) or CSS (.css) files not served properly

A standard issue with custom Nginx configurations is, that JavaScript (.js) or CSS (.css) files are not served properly, leading to a 404 (File Not Found) error on those files and a broken web interface.

This could be caused by an inproper sequence of location blocks. The following sequence is correct:

  location ~ \.php(?:$|/) {
   ...
  }
  location ~ \.(?:css|js)$ {
   ...
  }

Other custom configurations like caching JavaScript (.js) or CSS (.css) files via gzip could also cause such issues.

Not all of my contacts are synchronized

Check for server timeouts! It turns out that CardDAV sync often fails silently if the request runs into timeouts. With PHP-FPM you might see a CoreDAVHTTPStatusErrorDomain error 504 which is an HTTP 504 Gateway timeout error. To solve this, first check the default_socket_timeout setting in /etc/php/7.0/fpm/php.ini and increase the above fastcgi_read_timeout accordingly. Depending on your server’s performance a timeout of 180s should be sufficient to sync an address book of ~1000 contacts.

Windows: Error 0x80070043 “The network name cannot be found.” while adding a network drive

The windows native WebDAV client might fail with the following error message:

Error 0x80070043 "The network name cannot be found." while adding a network drive

A known workaround for this issue is to update your web server configuration.

1. Create a map directive outside your server block

# Fixes Windows WebDav client error 0x80070043 "The network name cannot be found."
map "$http_user_agent:$request_method" $WinWebDav {
    default         0;
    "DavClnt:OPTIONS"   1;
}

2. Inside your server block on top of your location directives

location = / {
    if ($WinWebDav) { return 401; }
}
1 Like