[GH-ISSUE #282] No redirect with Nexcloud using https #251

Closed
opened 2026-02-26 06:31:46 +03:00 by kerem · 6 comments
Owner

Originally created by @MarAlMe on GitHub (Jan 27, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/282

I use the proxy manager for several web applications. All can be reached internally in the network via http and are made accessible via the proxy manager via https.
When I go to the Nextcloud page, the logon screen appears, but nothing happens after that. If I refresh the page, I will be forwarded to my files, etc.

When I go to the Nextcloud page via http both internally and externally, the forwarding works without any problems after login. Other web applications do not have this problem. I have already tried to enter the IP of the proxy manager (same host, all services run as docker container) in the config.php of the Nextcloud under trusted_proxies, unfortunately without success.

Originally created by @MarAlMe on GitHub (Jan 27, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/282 I use the proxy manager for several web applications. All can be reached internally in the network via http and are made accessible via the proxy manager via https. When I go to the Nextcloud page, the logon screen appears, but nothing happens after that. If I refresh the page, I will be forwarded to my files, etc. When I go to the Nextcloud page via http both internally and externally, the forwarding works without any problems after login. Other web applications do not have this problem. I have already tried to enter the IP of the proxy manager (same host, all services run as docker container) in the config.php of the Nextcloud under trusted_proxies, unfortunately without success.
kerem closed this issue 2026-02-26 06:31:46 +03:00
Author
Owner

@jc21 commented on GitHub (Jan 27, 2020):

Are you proxying with SSL?
Is the Websocket option turned on for this proxy host?
Is nextcloud also running with SSL?
What version/docker image of nextcloud are you using?
Are there any Javascript console errors after logging in?

I don't use nextcloud but I just spun up a fresh instance, using NPM for SSL termination and pure http for the nextcloud instance. I ran through the setup process no problem, then logged out and now the login won't let me in with my 100% valid password. Even with the wrong credentials it is doing the same thing, redirecting me back to login. Unlike you though, my refresh doesn't get me in.

<!-- gh-comment-id:579010283 --> @jc21 commented on GitHub (Jan 27, 2020): Are you proxying with SSL? Is the Websocket option turned on for this proxy host? Is nextcloud also running with SSL? What version/docker image of nextcloud are you using? Are there any Javascript console errors after logging in? I don't use nextcloud but I just spun up a fresh instance, using NPM for SSL termination and pure http for the nextcloud instance. I ran through the setup process no problem, then logged out and now the login won't let me in with my 100% valid password. Even with the wrong credentials it is doing the same thing, redirecting me back to login. Unlike you though, my refresh doesn't get me in.
Author
Owner

@MarAlMe commented on GitHub (Jan 28, 2020):

I´ve configured the NPM as shown:

2020-01-28 16_49_13-Nginx Proxy Manager
2020-01-28 16_49_46-Nginx Proxy Manager

I using the latest Version of Docker and Nextcloud (i reinstalled the Server two weeks ago).
I get this, when i try to login:

2020-01-28 21_06_01-https___cloud measuremedia de_login

And this, after i reload the site:

2020-01-28 21_07_09-Dateien -

I started and configured the Nextcloud Container befor i had run the NPM Container. Today i had run an complete new Nexcloud Container and make the setup over the external https Url, but i got the same behavior.
In the past I had configured a Nginx as a proxy and the login worked without any problems. Since I don't want to write different .conf files again, I wanted to use the NPM.

<!-- gh-comment-id:579438085 --> @MarAlMe commented on GitHub (Jan 28, 2020): I´ve configured the NPM as shown: ![2020-01-28 16_49_13-Nginx Proxy Manager](https://user-images.githubusercontent.com/46399498/73300272-05f45f80-4211-11ea-9443-8698dc010076.png) ![2020-01-28 16_49_46-Nginx Proxy Manager](https://user-images.githubusercontent.com/46399498/73300306-11478b00-4211-11ea-9a7e-81307b4d26a9.png) I using the latest Version of Docker and Nextcloud (i reinstalled the Server two weeks ago). I get this, when i try to login: ![2020-01-28 21_06_01-https___cloud measuremedia de_login](https://user-images.githubusercontent.com/46399498/73301145-8a93ad80-4212-11ea-8dcb-009abf4818d3.png) And this, after i reload the site: ![2020-01-28 21_07_09-Dateien -](https://user-images.githubusercontent.com/46399498/73301199-a008d780-4212-11ea-8f3a-43d1f133771d.png) I started and configured the Nextcloud Container befor i had run the NPM Container. Today i had run an complete new Nexcloud Container and make the setup over the external https Url, but i got the same behavior. In the past I had configured a Nginx as a proxy and the login worked without any problems. Since I don't want to write different .conf files again, I wanted to use the NPM.
Author
Owner

@jc21 commented on GitHub (Jan 29, 2020):

Interesting that the login request shows as cancelled. That config all looks ok but I would probably turn off caching assets, in case these third party apps somehow change their images or js between requests. It's uncommon but worth a try.

Do you have your old nginx config, we might be able to compare options?

<!-- gh-comment-id:579574214 --> @jc21 commented on GitHub (Jan 29, 2020): Interesting that the login request shows as cancelled. That config all looks ok but I would probably turn off caching assets, in case these third party apps somehow change their images or js between requests. It's uncommon but worth a try. Do you have your old nginx config, we might be able to compare options?
Author
Owner

@MarAlMe commented on GitHub (Jan 29, 2020):

Without caching assets i got no luck. Yeah, here´s my old config:

server {
listen 80;
listen [::]:80;
server_name my.domain.tld;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name my.domain.tld;
#SSL
ssl_certificate /etc/letsencrypt/live/my.domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/my.domain.tld/privkey.pem;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256;
ssl_prefer_server_ciphers on;
ssl_session_cache off;
ssl_session_timeout 10m;
#HSTS
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
#Webroot
root /usr/share/nginx/my.domain.tld;
index index.php index.htm index.html;
#Synchronisations-URLs CalDAV- und CardDAV
location /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
#Agents/Bots ohne Kennzeichnung blockieren
if ($http_user_agent = "") {
return 444;
}
#Agents/Bots blockieren
if ($bot = 1) {
return 444;
}
#Nur die HTTP Methoden erlauben, welche auch wirklich gebraucht werden
if (request_method !~ ^(DELETE|GET|HEAD|MKCOL|MOVE|OPTIONS|POST|PROPFIND|PROPPATCH|PUT|REPORT))
{
return 444;
}
#Weiterleitung
location / {
proxy_pass http://111.222.333.44:1234;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
#Uploadlimit deaktivieren
client_max_body_size 0;
}
}

<!-- gh-comment-id:579970280 --> @MarAlMe commented on GitHub (Jan 29, 2020): Without caching assets i got no luck. Yeah, here´s my old config: >server { listen 80; listen [::]:80; server_name my.domain.tld; return 301 https://$server_name$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name my.domain.tld; #SSL ssl_certificate /etc/letsencrypt/live/my.domain.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/my.domain.tld/privkey.pem; ssl_protocols TLSv1.2; ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256; ssl_prefer_server_ciphers on; ssl_session_cache off; ssl_session_timeout 10m; #HSTS add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"; #Webroot root /usr/share/nginx/my.domain.tld; index index.php index.htm index.html; #Synchronisations-URLs CalDAV- und CardDAV location /.well-known/carddav { return 301 $scheme://$host/remote.php/dav; } location /.well-known/caldav { return 301 $scheme://$host/remote.php/dav; } #Agents/Bots ohne Kennzeichnung blockieren if ($http_user_agent = "") { return 444; } #Agents/Bots blockieren if ($bot = 1) { return 444; } #Nur die HTTP Methoden erlauben, welche auch wirklich gebraucht werden if ($request_method !~ ^(DELETE|GET|HEAD|MKCOL|MOVE|OPTIONS|POST|PROPFIND|PROPPATCH|PUT|REPORT)$) { return 444; } #Weiterleitung location / { proxy_pass http://111.222.333.44:1234; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; #Uploadlimit deaktivieren client_max_body_size 0; } }
Author
Owner

@damianog commented on GitHub (Mar 27, 2020):

Have a look at #340 and try if it solve this issue too?

<!-- gh-comment-id:604896918 --> @damianog commented on GitHub (Mar 27, 2020): Have a look at #340 and try if it solve this issue too?
Author
Owner

@MarAlMe commented on GitHub (Apr 19, 2020):

Adding 'overwriteprotocol' => 'https' to Nextcloud's config.php solved the problem.

<!-- gh-comment-id:616222039 --> @MarAlMe commented on GitHub (Apr 19, 2020): Adding 'overwriteprotocol' => 'https' to Nextcloud's config.php solved the problem.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#251
No description provided.