Hi,
Trying to set up Nextcloud on my RPi 4 with docker and nginx proxy manager for reverse proxy. My ISP blocks port 443, so I use port 444 to listen to for SSL connections.
I am currently unable to access nextcloud.domain.tld from my laptop (on the same network) and my phone(on cellular). On my RPi 4 when I enter https://nextcloud.domain.tld:444 → I get redirected to the login page of nginx itself. Any help is much appreciated. Thank you
My docker-compose file is this -
version: '3'
volumes:
nextcloud-data:
nextcloud-db:
networks:
nginx:
external: true
services:
nextcloud-app:
image: nextcloud
restart: always
ports:
- 8500:80
volumes:
- nextcloud-data:/var/www/html
environment:
- MYSQL_PASSWORD=<redacted>
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=nextcloud-db
- PHP_UPLOAD_LIMIT=10G
- PHP_MEMORY_LIMIT=2G
networks:
- nginx
nextcloud-db:
image: mariadb
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
ports:
- 3306:3306
volumes:
- nextcloud-db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=<redacted>
- MYSQL_PASSWORD=<redacted>
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
networks:
- nginx
My config file is -
<?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' => <redacted>,
'passwordsalt' => <redacted>,
'secret' => <redacted>,
'trusted_domains' =>
array (
0 => 'nextcloud.domain.tld',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'mysql',
'version' => '25.0.1.1',
'overwrite.cli.url' => 'https://nextcloud.domain.tld',
'dbname' => 'nextcloud',
'dbhost' => 'nextcloud-db',
'dbport' => '3306',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => <redacted>,
'installed' => true,
);
My nginx proxy config is -
# ------------------------------------------------------------
# nextcloud.domain.tld
# ------------------------------------------------------------
server {
set $forward_scheme http;
set $server "192.168.1.165";
set $port 8500;
listen 80;
listen [::]:80;
listen 444 ssl http2;
listen [::]:444 ssl http2;
server_name nextcloud.domain.tld;
# Let's Encrypt SSL
include conf.d/include/letsencrypt-acme-challenge.conf;
include conf.d/include/ssl-ciphers.conf;
ssl_certificate /etc/letsencrypt/live/npm-9/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-9/privkey.pem;
# Asset Caching
include conf.d/include/assets.conf;
# Block Exploits
include conf.d/include/block-exploits.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;
# Force SSL
include conf.d/include/force-ssl.conf;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
access_log /data/logs/proxy-host-7_access.log proxy;
error_log /data/logs/proxy-host-7_error.log warn;
location / {
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security "max-age=63072000;includeSubDomains; preload" always;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Proxy!
include conf.d/include/proxy.conf;
}
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}
Solved by using Nextcloudpi