I am trying to put my docker nextcloud behind an nginx.
For the nginx i used the letsencrypt image from linuxserver but I used the official docker image for nextcloud.
this is my nginx config
server {
listen 443 default ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
proxy_set_header X-FORWARDED-PROTO https;
root /config/www;
index index.html index.htm index.php;
server_name _;
ssl on;
# enable subfolder method reverse proxy confs
include /config/nginx/proxy-confs/*.subfolder.conf;
# all ssl related config moved to ssl.conf
include /config/nginx/ssl.conf;
# enable for ldap auth
#include /config/nginx/ldap.conf;
client_max_body_size 0;
location / {
try_files $uri $uri/ /index.html /index.php?$args =404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
location = /.well-known/carddav {
return 301 $scheme://$host/nextcloud/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/nextcloud/remote.php/dav;
}
location /nextcloud {
return 301 $scheme://$host/nextcloud/;
}
location ^~ /nextcloud/ {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_nextcloud nextcloud;
rewrite /nextcloud(.*) $1 break;
proxy_pass http://$upstream_nextcloud:80;
proxy_max_temp_file_size 2048m;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_set_header Connection $http_connection;
proxy_redirect off;
proxy_ssl_session_reuse off;
}
}
As soon as I try to connect with the nextcloud client I get this message:
The plain HTTP request was sent to HTTPS port.
Any ideas?