Im new here and would like to ask a question about an error when trying to upload a photo using the memories app.
When selecting a photo in the app and try to send it to my nextcloud server the following error message Spears in the log file:
[webdav] Fout: X-OC-MTime header must be a valid positive integer
I had the same issue uploading large files from Android web browsers via share link, the solution I found for my setup (NGINX reverse proxy) was to replace the negative X-OC-MTime header value sent by the web client with the current time.
I added a map in nginx.conf to replace negative values of X-OC-MTime:
My fix is done in NGINX, first you have to create a new variable that will be the value of $http_x_oc_mtime only if it’s valid, else it will be the current time.
Here’s my /etc/nginx/nginx.conf file (where the variable is defined):
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$http_x_oc_mtime"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
map $http_x_oc_mtime $xocmtimefix { # <-- the new variable
"~^-\d+" "$msec";
default $http_x_oc_mtime;
} # <------------------------------------ the new variable
include /etc/nginx/conf.d/*.conf;
}
Once you modify your nginx.conf you’ll have to restart your NGINX for the variable to be available to be used. Once you have done that, here’s the usage of the variable itself in a *.conf file, in my case I have Nextcloud under the mysite.com/nextcloud path, but it should be the same on the root path if that’s your case:
Once you modify your *.conf file (e.g. default.conf, mysite.conf) you just have to reload NGINX.
Check for <-- in the code examples to get what you have to copy/paste into your NGINX reverse proxy setup.
I did some research and noticed that the timzone in the nextcloud containers is utc. Thats not the zone I live in. I read that the nextcloud containers use their own timezone. I tried to modify it in truenas but its not allowed.
I continu my search for a proper solution, but I like to share this info with you guys.