J0jEE5f1

2021-09-13 17:00

			root@pvevm-omv:/opt/docker/swagger/nginx# cat proxy.conf
## Version 2021/04/27 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/proxy.conf

# Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

# Proxy Connection Settings
proxy_buffers 32 4k;
proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 240;
proxy_redirect  http://  $scheme://;
proxy_send_timeout 240;

# Proxy Cache and Cookie Settings
proxy_cache_bypass $cookie_session;
#proxy_cookie_path / "/; Secure"; # enable at your own risk, may break certain apps
proxy_no_cache $cookie_session;

# Proxy Header Settings
proxy_set_header Connection $connection_upgrade;
proxy_set_header Early-Data $ssl_early_data;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Real-IP $remote_addr;

root@pvevm-omv:/opt/docker/swagger/nginx# cat proxy-confs/nextcloud.subfolder.conf
## Version 2021/07/14
# Assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
#  'trusted_proxies' => ['swag'],
#  'overwritewebroot' => '/nextcloud',
#  'overwrite.cli.url' => 'https://your-domain.com/nextcloud',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
#  array (
#    0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
#    1 => 'your-domain.com',
#  ),

location ^~ /.well-known {
        # The rules in this block are an adaptation of the rules
        # in the Nextcloud `.htaccess` that concern `/.well-known`.

        location = /.well-known/carddav { return 301 /nextcloud/remote.php/dav/; }
        location = /.well-known/caldav  { return 301 /nextcloud/remote.php/dav/; }

        # Let Nextcloud's API for `/.well-known` URIs handle all other
        # requests by passing them to the front-end controller.
        return 301 /nextcloud/index.php$request_uri;
    }

location ^~ /nextcloud/ {
    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app nextcloud;
    set $upstream_port 443;
    set $upstream_proto https;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    rewrite /nextcloud(.*) $1 break;
    proxy_max_temp_file_size 2048m;
    proxy_set_header Range $http_range;
    proxy_set_header If-Range $http_if_range;
    proxy_ssl_session_reuse off;
}



version: '3'
services:
  mariadb:
    container_name: mariadb
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF
    restart: always
    volumes:
      - mariadb:/var/lib/mysql
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=...
      - MYSQL_PASSWORD=...
      - MYSQL_DATABASE=omv-next-db100
      - MYSQL_USER=nextcloud
      - TZ=Europe/Berlin

  nextcloud:
    container_name: nextcloud
    links:
      - mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
    volumes:
      - /srv/dev-1/nextcloud/html:/var/www/html
      - /srv/dev-1/nextcloud/custom_apps:/var/www/html/custom_apps
      - /srv/dev-1/nextcloud/config:/var/www/html/config
      - /srv/dev-1/nextcloud/data:/var/www/html/data
      - /srv/dev-1/nextcloud/themes:/var/www/html/themes/
    image: nextcloud
    restart: always
  swag:
    image: ghcr.io/linuxserver/swag
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - URL=mydomain.de
      - SUBDOMAINS=x,xx,xxx
      - VALIDATION=http
    volumes:
      - /opt/docker/swagger:/config
    ports:
      - 443:443
      - 80:80 #optional
    restart: unless-stopped
    
volumes:
  mariadb: # nextcloud

root@pvevm-omv:/opt/docker/swagger/nginx# cat /srv/dev-1/nextcloud/config/config.php
<?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' => '',
  'passwordsalt' => '+',
  'secret' => 'U',
  'trusted_domains' =>
  array (
    0 => 'pvevm-omv:8082', #from previous configuration/docker compose (worked fine with: x.mydomain.de:8082 and port forwarding)
    1 => 'x.mydomain.de',
    2 => 'mydomain.de',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '22.1.1.2',
  'overwrite.cli.url' => 'http://pve-omv:8082',
  'dbname' => 'omv-next-db100',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '',
  'installed' => true,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'smtp..de',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '',
  'mail_domain' => '.de',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '25',
  'mail_smtpname' => '@.de',
  'mail_smtppassword' => '!',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'tls',
  'trusted_proxies' => ['swag'],
  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => 'https://x.mydomain.de/nextcloud',
);
root@pvevm-omv:/opt/docker/swagger/nginx#