Desktop Client is trying to use HTTP instead of HTTPS

same issue here. (docker container+swag (letsencrypt+nginx container) for rProxy)

What i’ve noticed is all URL’s in the webui are pointing to HTTPS apart from the webdav and the Server address URL given at https://serverFQDN/nextcloud/settings/user/sync-clients which both reference http:// locations. I’m assuming the desktop client is using the Server Address URL as given on that sync-clients page and thats the issue, but how do we fix?

lil’ help here please on what needs to be done! :slight_smile:

edit: SOLVED for me. turns out i was missing ‘overwriteprotocol’ => ‘https’, in config.php. I’m guessing something has changed recently as my previous build notes havent covered this and nore does swags included rproxy nextcloud config.

5 Likes

I had the same issue and was able to fix it without much troubleshooting thanks to your note.

Thank you for putting the time in to write it up!

My Nextcloud servers are all behind an NGINX reverse proxy and I had to include the following in my nextcloud/config/config.php files:

  'overwrite.cli.url' => 'https://nextcloud.server.com/nextcloud',
  'overwriteprotocol' => 'https',

That worked for me but it may be because I am behind a reverse proxy.

Paul

5 Likes

Hello, I had the same problem, I have set both overwrite.cli.url and overwriteprotocol but it was still not working…

But what did fixed it for me was REMOVING overwritecondaddr parameter! After removing it, everything is working now for me.

2 Likes

Hello, I have the same problem and for me adding overwriteprotocol is not working, and overwritecondaddr is not set. My nextcloud is old, 14.0.11, hope that this does not matter, I am stuck on this version and can’t upgrade.

By the way, I’m okay with just forcing the URL if I can do that somewhere, it’s just a small install for myself and all I need is this login to succeed.

This solution helped me. Thanks a lot!

I have nextcloud installed on a ubuntu 20.04 server (nextcloud) behind a ubuntu 20.04 reverse proxy server. Both use apache2. They are in separate boxes and both use private IP’s (192.168.x.x). Clients receive a certificate from the proxy and are then proxied to nextcloud using proxypass and proxypassreverse. Hence, the client uses https but from then on the two servers use http.
I have set up webdav on nextcloud.
Nextcloud at its web interface works fine and I can map the webdav directory to the nextcloud installation using Windows 10.
I have installed the nextcloud app on Windows 10 but I cannot initialise it. It refuses to accept that I am using https.
Part of the problem is that I can’t find documentation on the meaning of directives in the config. I am worried about “overwrite” because any rewrites should be handled by the proxy. Nextcloud is no use to me without the sync function which appears to be unavailable without the desktop app. I think the problem is the nextcloud config which may have been designed without attention to having a reverse proxy in a separate box. There may also be conflicts with the apache2 proxypass directive as I am not using the alternative rewrite protocol and the nextcloud config may assume I am. I don’t want to install a private cert on nextcloud because I don’t see any security problems with using http on the private LAN
my config is:
$CONFIG = array (
‘trusted_proxies’ => [‘IP of proxy’],
‘instanceid’ => ‘xyz’,
‘passwordsalt’ => ‘xyz’,
‘secret’ => ‘xyz’,
‘trusted_domains’ =>
array (
0 => ‘proxy name in /etc/hosts:8080’,
),
‘datadirectory’ => ‘/var/www/html/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘22.1.1.2’,
‘overwrite.cli.url’ => ‘http://nextcloud name in /etc/hosts:8080’,
‘dbname’ => ‘xyz’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => ‘xyz’,
‘dbpassword’ => ‘’,xyz
‘installed’ => true,
‘app_install_overwrite’ =>
array (
0 => ‘twofactor_yubikey’, # I don’t know why this is here as another problem is that I can’t setup a yubikey - what does the ‘0’ mean?
),
);

I have now found the config file documentation. I have added overwriteprotocol setting it to http. So I assume that will force http back to the reverse proxy. I have also added the proxy to trusted domains in all its different forms. Neither of these things have made any difference. I still get the error that polling http! I still can’t log in to the desktop app.

Thanks, this worked for me too, url without http(s).
Best.

Same problem here with nextcloud served by apache and haproxy in front of it for ssl termination.

Everything works fine except nextcloud desktop client (nextcloud mobile client has some other issues).

It still works using the old owncloud clients, though.

Update: overwriteprotocol and overwrite.cli.url seems to have solved the issue. Thanks.

If you are using the nextcloud docker image you can set the env
OVERWRITEPROTOCOL=https
for the app container

2 Likes

Finally, this solved my issue! Thank you so much!
My wife and me were stuck with Client version Nextcloud-3.2.4 and now it is working again.

But i am still concerned that this can not be the most healthy way to do this. Some day this might backfire when every switch i had to flip to make things work start to collide with each other.

Tried everything suggested here…I’m not behind a proxy.

My instance continues to generates http URL.
I created a new subject here Using http even with overwriteprotocol configured...can't obtain grant on apps to avoid mixing with proxys issues.

Help ?

Had the same problem like here described, tried every configuration and nothing helped… except a restart of the docker container with the following configuration

  'overwrite.cli.url' => 'https://nextcloud.server.com/nextcloud',
  'overwriteprotocol' => 'https',
1 Like

I have this issue and none of the solutions worked for me. It is very frustrating and I’m not sure where to go next

So, since I posted this I have now managed to resolve the issue. There were two things I had to do above having the overwriteprotocol and overwrite.cli.url set. I had to remove overwritecondaddr which wasn’t enough on it’s own but a necessary step. My regular setup has a redirect from http to https to enforce the use of https, I had to remove this for the duration of the client installs. Once I was logged in and working then I could re-enable this step. I’m aware that I may have to disable this every time I have to install a new client but at least I’m up and running for now

Fixed it for the helm chart in this PR: Sets OVERWRITEPROTOCOL env var in deployement.yaml for http to https redirect to work by stevek-pro ¡ Pull Request #210 ¡ nextcloud/helm ¡ GitHub

Very helpful thanks

1 Like

Legend. Fixed it for me

Thanks, no overwrite url & protocol helped me, too!