Reverse Proxy login page only displays text and no forms / images / styles

Nextcloud version: 22.0.0.11
Operating system and version : Ubuntu 18.04 LTS
Apache or nginx version: 2.4.29
PHP version: 7.2

The issue you are facing:
When accessing nextcloud via reverse proxy the login page only displays plain old HTML text with the following content:

# Nextcloud

[Nextcloud](https://nextcloud.com) – a safe home for all your data

Login is not possible. No buttons, no images. Just a naked html text with default background

Steps to replicate it:

  1. Run a fresh nextcloud docker container and bind it to a port (eg. 8080) on your server.
  2. Setup a ProxyPass/ProxyPassReverse in your apache configuration that maps that port to a path on your SSL secured webpage. For example, if your Domain is example.org:
ProxyPass "/nextcloud" "http://127.0.0.1:8080"
ProxyPassReverse "/nextcloud" "http://127.0.0.1:8080"
  1. Access nextcloud via https://example.org/nextcloud → You will see that the login page only displays plain text and does not provide any login forms nor buttons.

The purpose of this configuration is to use the reverse proxy to pass SSL secured traffic via https://example.org to the unsecured nextcloud server that is running on the same machine. Accessing nextcloud directly via example.org:8080 works perfectly fine and displays everything as intended, but is not SSL secured.

The output of your Nextcloud log in Admin > Logging:
I don’t know how to access this as I just now setup nextcloud

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' => 'oc03t80z3i26',
  'passwordsalt' => 'no',
  'secret' => 'no',
  'trusted_domains' =>
  array (
    0 => 'youdont.need.to.know.that',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '22.0.0.11',
  'overwrite.cli.url' => 'youdont.need.to.know.that:8080',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'nope',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

apache error.log

[Sat Jul 10 20:03:40.253458 2021] [mpm_event:notice] [pid 597:tid 140372076686272] AH00493: SIGUSR1 received.  Doing graceful restart
[Sat Jul 10 20:03:43.271134 2021] [ssl:warn] [pid 597:tid 140372076686272] AH01909: default:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jul 10 20:03:43.271384 2021] [mpm_event:notice] [pid 597:tid 140372076686272] AH00489: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1 configured -- resuming normal operations
[Sat Jul 10 20:03:43.271399 2021] [core:notice] [pid 597:tid 140372076686272] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jul 10 20:13:50.170559 2021] [mpm_event:notice] [pid 597:tid 140372076686272] AH00493: SIGUSR1 received.  Doing graceful restart
[Sat Jul 10 20:13:53.191798 2021] [ssl:warn] [pid 597:tid 140372076686272] AH01909: default:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jul 10 20:13:53.192086 2021] [mpm_event:notice] [pid 597:tid 140372076686272] AH00489: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1 configured -- resuming normal operations
[Sat Jul 10 20:13:53.192102 2021] [core:notice] [pid 597:tid 140372076686272] AH00094: Command line: '/usr/sbin/apache2'

I suspect that the reverse proxy somehow prevents the execution of js scripts or causes some other scripting related issue, but I wouldn’t know how to fix that problem. Help is greatly appreciated.

I have more or less solved the problem. Nextcloud was not able to find the appropriate .js and .css files, because of the proxy. However, instead of proxying a path on the main domain, I proxied a subdomain and it worked fine.