Project

General

Profile

Actions

Installing on with a Nginx with a reverse proxy using a Nginx Proxy Manager

Nginx Proxy Manager


  1. Add an A record pointing to your Nginx Proxy Manager installation.
  2. Add a Proxy Host and install SSL. Force SSL = ON, HTTP/2 Suport = ON, HSTS Enabled = ON
  3. In the custom location, add the root / directory and /var/www/html/nextcloud/data/.

In the Advanced tab, add the following headers:


add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy same-origin;
location /.well-known/carddav {
    return 301 $scheme://$host/remote.php/dav;
}

location /.well-known/caldav {
    return 301 $scheme://$host/remote.php/dav;
}


---

SEE Reverse Proxy

File configuration

In the Setting menu in your Nextcloud, under Security & setup warnings,

You might see,

There are some warnings regarding your setup.

"You are accessing your instance over a secure connection, however your instance is generating insecure URLs. This most likely means that you are behind a reverse proxy and the overwrite config variables are not set correctly. Please read the documentation page about this"

Add the following to the config.php

nano /var/www/html/nextcloud/config/config.php

Add

'trusted_proxies' => 
  array (
    0 => ' Your Nginx Proxy Manager IP ',
  ),

EXAMPLE


<?php
$CONFIG = array (

'trusted_proxies' => 
  array (
    0 => '192.168.1.41',
  ),

.....
.....

'overwrite.cli.url' => '',
Use this configuration parameter to specify the base URL for any URLs which are generated within Nextcloud using any kind of command line tools (cron or occ). The value should contain the full base URL: https://www.example.com/nextcloud

'overwrite.cli.url' => 'https://www.example.com/',

Updated by Gareth Eaton 5 months ago · 25 revisions