Timezone dropdown is blank on the last setup page of the UniFi Controller

This a copy of the GitHub issue I created.

Expected Behavior

I should be able to complete the setup wizard.

Current Behavior

On the last step, the timezone dropdown is blank, so I can’t select a timezone to complete the controller setup.

The browser JavaScript console lists two error messages:

Something went wrong! undefined main.3fb48c11846a8faf4b12.js:1:48814
Something went wrong! undefined main.3fb48c11846a8faf4b12.js:1:123742

The JavaScript calls the URL /v2/api/timezones, which loads a JSON list of timezones if I view in directly in a browser.

I’m thinking this might be an upstream bug in the UniFi Controller application

Steps to Reproduce

  1. Used the “Advanced setup” option in the initial controller setup wizard
  2. Advance to the last step

Environment

OS: Ubuntu Server 20.10
CPU architecture: arm64
How docker service was installed: docker-compose Ubuntu package

Command used to create docker container (run/create/compose/screenshot)

Same as the docker-compose.yaml in the README.

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    997
User gid:    997
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /config/data/keystore -destkeystore /config/data/keystore -deststoretype pkcs12".
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
WARN Unable to load properties from '/usr/lib/unifi/data/system.properties' - /usr/lib/unifi/data/system.properties (No such file or directory)

I figured out what the issue was. I had to pass the reverse proxy traffic to the HTTPS port 8443, and not the HTTP port 8080, even over localhost. I also had to download the self-signed certificate generated by the UniFi controller using my browser on port 8443, then upload that to the server, and configure Nginx to trust that certifictificate downstream. My full Nginx config is:

erver {
    server_name unifi.example.net;

    location / {                                                                                                        
        proxy_pass https://127.0.0.1:8443;                                                                           
        proxy_ssl_trusted_certificate /etc/nginx/ssl/unifi.crt;                                                            
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;                                                                                     
        proxy_set_header X-Real-IP $remote_addr;                                                                         
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                                                     
    }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/unifi.example.net/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/unifi.example.net/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 = unifi.example.net) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80 default_server;
    listen [::]:80 default_server;

    server_name unifi.example.net;
    return 404; # managed by Certbot
}