Fresh reverse proxy installation nos working as expected

Hi. I’m trying to install a new instance of Nextcloud, using docker image.

Since i’m using a Nginx reverse poxy, i’m using the tutorial for Reverse Proxy.

The command to start the container used is:

sudo docker run \
    --init \
    --sig-proxy=false \
    --name nextcloud-aio-mastercontainer \
    --restart always \
    --publish 8080:8080 \
    --env APACHE_PORT=11000 \
    --env APACHE_IP_BINDING=0.0.0.0 \
    --env SKIP_DOMAIN_VALIDATION=true \
    --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
    --volume /var/run/docker.sock:/var/run/docker.sock:ro \
    nextcloud/all-in-one:latest

It includes SKIP_DOMAIN_VALIDATION, so it was the only way to installer to work.
Used the Nextcloud default version 27.
Unchecked all optional containers.

The configuration of NGNIX is:

server {
        server_name files.tuaiti.com.ar www.files.tuaiti.com.ar mail.files.tuaiti.com.ar;
        listen 172.21.15.23;
        root /home/files/public_html;
        index index.php index.htm index.html;
        access_log /var/log/virtualmin/files.tuaiti.com.ar_access_log;
        error_log /var/log/virtualmin/files.tuaiti.com.ar_error_log;
        fastcgi_param GATEWAY_INTERFACE CGI/1.1;
        fastcgi_param SERVER_SOFTWARE nginx;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param CONTENT_TYPE $content_type;
        fastcgi_param CONTENT_LENGTH $content_length;
        fastcgi_param SCRIPT_FILENAME "/home/files/public_html$fastcgi_script_name";
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_param REQUEST_URI $request_uri;
        fastcgi_param DOCUMENT_URI $document_uri;
        fastcgi_param DOCUMENT_ROOT /home/files/public_html;
        fastcgi_param SERVER_PROTOCOL $server_protocol;
        fastcgi_param REMOTE_ADDR $remote_addr;
        fastcgi_param REMOTE_PORT $remote_port;
        fastcgi_param SERVER_ADDR $server_addr;
        fastcgi_param SERVER_PORT $server_port;
        fastcgi_param SERVER_NAME $server_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS $https;
        location ^~ /.well-known/ {
                try_files $uri /;
        }
        location / {
                proxy_pass http://172.21.15.45:11000/;

                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Port $server_port;
                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 "";

                client_body_buffer_size 512k;
                proxy_read_timeout 86400s;
                client_max_body_size 0;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection Upgrade;
                proxy_set_header Host $host;
        }
        location ~ "\.php(/|$)" {
                try_files $uri $fastcgi_script_name =404;
                default_type application/x-httpd-php;
                fastcgi_pass unix:/var/php-nginx/1706985703246682.sock/socket;
        }
        fastcgi_split_path_info "^(.+\.php)(/.+)$";
        location /cgi-bin/ {
                gzip off;
                root /home/files/cgi-bin;
                fastcgi_pass unix:/var/fcgiwrap/1706985703246682.sock/socket;
                fastcgi_param SCRIPT_FILENAME "/home/files$fastcgi_script_name";
                fastcgi_param GATEWAY_INTERFACE CGI/1.1;
                fastcgi_param SERVER_SOFTWARE nginx;
                fastcgi_param QUERY_STRING $query_string;
                fastcgi_param REQUEST_METHOD $request_method;
                fastcgi_param CONTENT_TYPE $content_type;
                fastcgi_param CONTENT_LENGTH $content_length;
                fastcgi_param SCRIPT_NAME $fastcgi_script_name;
                fastcgi_param REQUEST_URI $request_uri;
                fastcgi_param DOCUMENT_URI $document_uri;
                fastcgi_param DOCUMENT_ROOT /home/files/public_html;
                fastcgi_param SERVER_PROTOCOL $server_protocol;
                fastcgi_param REMOTE_ADDR $remote_addr;
                fastcgi_param REMOTE_PORT $remote_port;
                fastcgi_param SERVER_ADDR $server_addr;
                fastcgi_param SERVER_PORT $server_port;
                fastcgi_param SERVER_NAME $server_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param HTTPS $https;
        }
        listen 172.21.15.23:443 ssl;
        ssl_certificate /etc/ssl/virtualmin/1706985703246682/ssl.combined;
        ssl_certificate_key /etc/ssl/virtualmin/1706985703246682/ssl.key;
}
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

I can reach the point of login in to the Nextcloud instance as admin user. The web interface does not work properly, as many options presents several errors.
In the inspecti windows of Chrome, I see a lot of 404 HTTP Errors like:

https://files.tuaiti.com.ar/ocs/v2.php/search/providers?from=%2Fapps%2Ffiles%2F
https://files.tuaiti.com.ar/ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json

All the errors seems to be all from https://files.tuaiti.com.ar/ocs/v2.php urls.

Thank you.

I’m not entirely clear on what you’re trying to do, but your config appears to be a highly modified version of the example one provided[1]. Is there a reason you’ve modified it?

The first major issue I see is that you’re trying to handle php files directly on your proxy which doesn’t make any sense with an AIO setup.

Double-check the example linked and try working with that.

[1] all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub

1 Like