Nextcloud 17 docker and nginx reverse proxy
sigh sometimes I hate this adminstration stuff but it was necessary as I'm migrating stuff to containerd version. This time I choosed to spend my time in migrating my existing nextcloud installation to the docker version (and upgrading during this process (everytime a great idea)). However I ended up in a running version but I could not connect from my apps because the new authorization process stuck in calling /login/v2/poll. After googling around I found one little thing and that's this entry which has to be added to the config.php file which can be found in the mounted volume of the nextcloud container:
'overwriteprotocol' => 'https',
It's simply forcing the nextcloud to use https in the given URLs instead of http. To have it complete, here's my nginx reverse proxy configuration:
server {
listen 80;
server_name your_host_name;
# enforce https
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name your_host_name;
ssl_certificate /etc/letsencrypt/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/privkey.pem;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_buffering off;
proxy_pass http://localhost:8080;
}
}
Yep it's not the philosopher's stone but maybe it prevents others from searching around and waste time.