When i click on Open Your Nextcloud, keep routing back to same page

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud AIO version (eg, 20.0.5): 4.4.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): nginx
PHP version (eg, 7.4): replace me

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. When i Click of Open Nextcloud keeps routing to same page

Hi, did you follow all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub step-for-step?

Yes, I did.
Tried doing it multiple times now.

Can you post the docker-compose file or docker run command of AIO that you used, the nginx docker-compose or docker run command and your nginx config here?

I had port 8080 in use, hence used 9000

This was the docker run command that I used :

sudo docker run -d
–sig-proxy=false
–name nextcloud-aio-mastercontainer
–restart always
–publish 9000:8080
-e APACHE_PORT=11000
-e APACHE_IP_BINDING=127.0.0.1
–volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config
–volume /var/run/docker.sock:/var/run/docker.sock:ro
-e NEXTCLOUD_DATADIR=/DEV/nextCloud
-e SKIP_DOMAIN_VALIDATION=true
nextcloud/all-in-one:latest

Nginx Configuration File
map $http_upgrade $connection_upgrade {
default upgrade;
‘’ close;
}

server {
listen 80;
listen [::]:80; # comment to disable IPv6
if ($scheme = “http”) {
return 301 https://$host$request_uri;
}

listen 443 ssl http2;
listen [::]:443 ssl http2; # comment to disable IPv6
include ./ssl.conf;
server_name nextcloud.sutradhar.tech;

location / {
    resolver localhost; # Note: you need to set a valid dns resolver here or use 127.0.0.1 / [::1] instead of localhost in the line below. See https://stackoverflow.com/a/49642310 for a better explan>
    proxy_pass https://localhost:9000$request_uri; # Note: you need to change localhost to 127.0.0.1 or [::1], if you don't use a valid dns resolver in the line above

    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header Early-Data $ssl_early_data;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Accept-Encoding "";
    proxy_set_header Host $host;

    client_body_buffer_size 512k;
    proxy_read_timeout 86400s;
    client_max_body_size 0;

    # Websocket
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
}

ssl_early_data on;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m; # about 40000 sessions
ssl_session_tickets off;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES12>
ssl_prefer_server_ciphers off;

}

You need to change proxy_pass https://localhost:9000$request_uri; to proxy_pass http://localhost:11000$request_uri; and it should work if your nginx should be running on the host and not inside a container.

My Nginx is running on the host, I tried 11000, gives Nginx 502 Bad Gateway error

Ah yes. http://localhost:11000$request_uri; should be correct (http and not https).

The following Error used to occur hence updated to https

Bad Request

Your browser sent a request that this server could not understand.
Reason: You’re speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Can you try http://127.0.0.1:11000$request_uri;

Now it went to Login Screen.
Thankyou, for the support, much appreciated.

Great! Please mark one of the answers as solution