Nextcloud on Ubuntu behind reverse NGINX proxy manager

110 Views Asked by At

I recently installed Nextcloud on Ubuntu with IP 192.168.0.14/nextcloud behind reverse proxy. Because I use NGINX Proxy manager for other "engines" in my inner net as well, I intended to use it for my Nextcloud as well. Honestly, I don't know a lot about "packet magic" thus I've been strugling since that time with correct setup. If I put into a browser row 192.168.0.14/nextcloud, everything is fine - respond is http://192.168.0.14/nextcloud/index.php/login and I'm able to get in. Whenever I put there https://xxx.duckdns.org:123 (this port is forwarded by proxy to 192.168.0.14/nextcloud port 80 - see the proxy settings bellow), I get xxx.duckdns.org/nextcloud/index.php/login as well, but the page depicts "This site is unavailable - web xxx.duckdns.org refused to connect."

my proxy settings: IP address 192.168.0.12

{

  "id": 6,
  "created_on": "2024-01-21 14:57:22",
  "modified_on": "2024-01-30 22:54:06",
  "owner_user_id": 1,
  "domain_names": [
    "xxx.duckdns.org"
  ],
  "forward_host": "192.168.0.14",
  "forward_port": 80,
  "access_list_id": 0,
  "certificate_id": 10,
  "ssl_forced": true,
  "caching_enabled": false,
  "block_exploits": true,
  "advanced_config": "",
  "meta": {
    "letsencrypt_agree": false,
    "dns_challenge": false
  },
  "allow_websocket_upgrade": true,
  "http2_support": true,
  "forward_scheme": "http",
  "enabled": 1,
  "locations": [
    {
      "path": "/",
      "advanced_config": "",
      "forward_scheme": "http",
      "forward_host": "192.168.0.14/nextcloud/",
      "forward_port": 80
    }
  ],
  "hsts_enabled": false,
  "hsts_subdomains": false
}

my nextcloud config.php settings

$CONFIG = array (
  'instanceid' => '...........',
  'passwordsalt' => '.............',
  'secret' => '................',
  'trusted_domains' =>
  array (
    0 => '192.168.0.14',
    1 => 'xxx.duckdns.org',
    2 => '192.168.88.1',
    3 => '192.168.0.12',
    4 => '192.168.0.1',
    5 => '127.0.0.1',
  ),
  'overwrite.cli.url' => 'http://192.168.0.14/nextcloud',
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.1.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '..........',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'default_phone_region' => 'CZ',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '........',
  'mail_domain' => '.....',
  'mail_smtphost' => 'smtp......',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '......',
  'mail_smtpname' => '.........',
  'mail_smtppassword' => '.........',
  'trusted_proxies' =>
  array (
    0 => '192.168.0.12',
  ),
);

Can anybody help me and suggest what I need to change? Or do you need more details?

Thanks a lot

0

There are 0 best solutions below