Nextcloud version 17.0.5: docker apache
Operating system and version Ubuntu 18.04:
Apache or nginx version Apache:
PHP version 7.3:
Reverse Proxy IP: 10.1.3.112
Ubuntu 18.04 Server running Nextcloud docker IP: 10.1.3.114
The issue you are facing:
I have a Nginx reverse proxy running on another virtual server. Nginx 1.17.7, Ubuntu 18.04, and Certbot/LetsEncrypt for SSL. I can enter my custom domain into any browser and I get a https://my.domain.com/login screen. I type my user name and password and click Log in. nothing happens. I can then refresh the web page and I am taken into Nextcloud. If I enter http://10.1.3.114:80 on my local network, I get to the same Nextcloud login. I enter the username and password, click log in and I am taken directly to the file screen. My guess is that the issue lies somewhere is the reverse proxy redirect.
Is this the first time you’ve seen this error? (Y/N): N I tried it under Nextcloud 18.0.3 docker w/ Ubuntu 18.04 and the issue still happened. So I ran Nextcloud 17.0.5 to see if the issue was just the newer 18.0.3 version it happen on both 17.0.5 and 18.0.3. This was a fresh install on both I am I testing this before setting up on my main server.
Steps to replicate it:
- Open my custom url
- Enter username and password.
- Click Log in
- The spinner on the log in button keeps going around and around. The page never redirects to the files screen.
- I can then press F5 or COMMAND + R to reload the page and I get to the file pages.
- This also affects the Andorid and iOS apps. Both the Nextcloud app and the Talk app. Neither will login.
The output of your Nextcloud docker output before refreshing the Log in page. The IP is my local lan IP of the computer I am on.
nextcloud | 10.1.3.112 - - [26/Mar/2020:01:43:39 +0000] "POST /login HTTP/1.0" 303 1140 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'instanceid' => 'ID',
'passwordsalt' => 'SALT',
'secret' => 'SECRET',
'trusted_domains' =>
array (
0 => '10.1.3.114',
1 => 'my.domain.com',
),
'trusted_proxies' => '10.1.3.112',
'overwriteprotcol' => 'https',
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '17.0.5.0',
'overwrite.cli.url' => 'http://10.1.3.114',
'dbname' => 'nextcloud',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'USER',
'dbpassword' => 'PASSWORD',
'installed' => true,
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
);
Nginx conf file on the reverse proxy.
server {
server_name my.domain.com;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
location / {
proxy_pass http://10.1.3.114:80/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 10G;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/my.domain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my.domain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = my.domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name my.domain.com;
listen 80;
return 404; # managed by Certbot
}