Nextcloud version: 21.0.2 (Docker Apache insecure)
Operating system and version: ‘Debian 10 Buster’
Apache or nginx version: Apache/2.4.38
PHP version (eg, 7.4): PHP 7.3.27-1~deb10u1 (cli)
The issue you are facing:
My Problem is that this warning doesn’t dissapear although I tried everything I red around here.
Before my server was running on a Raspberry Pi not in docker. There I could resolve this issue easily. Now with docker I am not able to fix it… But I think everything works just fine, thats the weird part. Maybe someone can look over my configs and tell me what the problem might be?
Docker-Compose File:
services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- ./Container-Daten/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=****************
env_file:
- db.env
redis:
image: redis:alpine
restart: always
app:
image: nextcloud:apache
restart: always
ports:
- ****:80
volumes:
- ./Container-Daten/html:/var/www/html
environment:
- MYSQL_HOST=db
- REDIS_HOST=redis
- VIRTUAL_HOST=nextcloud.secureserver.de
env_file:
- db.env
depends_on:
- db
- redis
cron:
image: nextcloud:apache
restart: always
volumes:
- ./Container-Daten/html:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
- redis
collab:
image: collabora/code
ports:
- ****:9980
environment:
- domain=nextcloud.secureserver.de
restart: always
Apache2 Reverse Proxy Config:
(Tried RewriteRule here but didn’t work)
<VirtualHost *:80>
ServerName nextcloud.secureserver.de
DocumentRoot /var/www/html
Redirect permanent / https://nextcloud.secureserver.de/
RewriteEngine on
RewriteCond %{SERVER_NAME} =nextcloud.secureserver.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerName nextcloud.secureserver.de
DocumentRoot /var/www/html
ProxyPreserveHost On
ProxyPass / http://192.168.178.**:****/
ProxyPassReverse / http://192.168.178.**:****/
SSLCertificateFile /etc/letsencrypt/live/nextcloud.secureserver.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.secureserver.de/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<Directory /var/www/html/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
LimitRequestBody 0
SSLRenegBufferSize 10486000
</Directory>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"
</IfModule>
#<IfModule mod_rewrite.c>
# RewriteEngine on
# RewriteRule ^\.well-known/carddav remote.php/dav [R=301,L]
# RewriteRule ^\.well-known/caldav remote.php/dav [R=301,L]
#</IfModule>
Nextcloud .htaccess file in the root folder "html"
<IfModule mod_headers.c>
<IfModule mod_setenvif.c>
<IfModule mod_fcgid.c>
SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
</IfModule>
<IfModule mod_proxy_fcgi.c>
SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
</IfModule>
<IfModule mod_env.c>
# Add security and privacy related headers
# Avoid doubled headers by unsetting headers in "onsuccess" table,
# then add headers to "always" table: https://github.com/nextcloud/server/pull/19002
Header onsuccess unset Referrer-Policy
Header always set Referrer-Policy "no-referrer"
Header onsuccess unset X-Content-Type-Options
Header always set X-Content-Type-Options "nosniff"
Header onsuccess unset X-Download-Options
Header always set X-Download-Options "noopen"
Header onsuccess unset X-Frame-Options
Header always set X-Frame-Options "SAMEORIGIN"
Header onsuccess unset X-Permitted-Cross-Domain-Policies
Header always set X-Permitted-Cross-Domain-Policies "none"
Header onsuccess unset X-Robots-Tag
Header always set X-Robots-Tag "none"
Header onsuccess unset X-XSS-Protection
Header always set X-XSS-Protection "1; mode=block"
SetEnv modHeadersAvailable true
</IfModule>
# Add cache control for static resources
<FilesMatch "\.(css|js|svg|gif)$">
Header set Cache-Control "max-age=15778463"
</FilesMatch>
# Let browsers cache WOFF files for a week
<FilesMatch "\.woff2?$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
</IfModule>
<IfModule mod_php7.c>
php_value mbstring.func_overload 0
php_value default_charset 'UTF-8'
php_value output_buffering 0
<IfModule mod_env.c>
SetEnv htaccessWorking true
</IfModule>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} DavClnt
RewriteRule ^$ /remote.php/webdav/ [L,R=302]
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]
RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
ModPagespeed Off
</IfModule>
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####
ErrorDocument 403 //
ErrorDocument 404 //
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav)$
RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
RewriteCond %{REQUEST_FILENAME} !core/img/manifest.json$
RewriteCond %{REQUEST_FILENAME} !/remote.php
RewriteCond %{REQUEST_FILENAME} !/public.php
RewriteCond %{REQUEST_FILENAME} !/cron.php
RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
RewriteCond %{REQUEST_FILENAME} !/status.php
RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
RewriteCond %{REQUEST_FILENAME} !/robots.txt
RewriteCond %{REQUEST_FILENAME} !/updater/
RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
RewriteCond %{REQUEST_FILENAME} !/ocm-provider/
RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
RewriteCond %{REQUEST_FILENAME} !/richdocumentscode(_arm64)?/proxy.php$
RewriteRule . index.php [PT,E=PATH_INFO:$1]
RewriteBase /
<IfModule mod_env.c>
SetEnv front_controller_active true
<IfModule mod_dir.c>
DirectorySlash off
</IfModule>
</IfModule>
</IfModule>
Nextcloud config.php in html/config/:
<?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,
),
),
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'redis',
'password' => '',
'port' => ******,
),
'instanceid' => '**************',
'passwordsalt' => '**************************************',
'secret' => '******************************************',
'trusted_domains' =>
array (
0 => 'nextcloud.secureserver.de',
),
'trusted_proxies' =>
array (
0 => 'nextcloud.secureserver.de',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '21.0.2.1',
'overwrite.cli.url' => 'https://nextcloud.secureserver.de',
'dbname' => 'nextcloud',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => '**************',
'installed' => true,
'overwritehost' => 'nextcloud.secureserver.de',
'overwriteprotocol' => 'https',
'app_install_overwrite' =>
array (
0 => 'occweb',
),
array (
0 => 'OC\\Preview\\TXT',
1 => 'OC\\Preview\\MarkDown',
2 => 'OC\\Preview\\OpenDocument',
3 => 'OC\\Preview\\PDF',
4 => 'OC\\Preview\\MSOffice2003',
5 => 'OC\\Preview\\MSOfficeDoc',
6 => 'OC\\Preview\\Image',
7 => 'OC\\Preview\\Photoshop',
8 => 'OC\\Preview\\TIFF',
9 => 'OC\\Preview\\SVG',
10 => 'OC\\Preview\\Font',
11 => 'OC\\Preview\\MP3',
12 => 'OC\\Preview\\Movie',
13 => 'OC\\Preview\\MKV',
14 => 'OC\\Preview\\MP4',
15 => 'OC\\Preview\\AVI',
),
'mail_from_address' => '*********',
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => 'smtp',
'mail_domain' => '****.com',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => '*********',
'mail_smtpport' => '****',
'mail_smtpname' => '**************@*****.com',
'mail_smtppassword' => '**********',
'mail_smtpsecure' => 'ssl',
'htaccess.RewriteBase' => '/',
'default_phone_region' => 'DE',
);