Share files between nextcloud and nas share

Currently reading
Share files between nextcloud and nas share

Hi

I've been trying to figure out how reverse proxy works.

As I don't control the dns server so I had to add the address to windows host file.

I've been trying to set up the reverse proxy to go to the http port(30080) of the container, but it fails with the message "Sorry, the page you are looking for is not found."
To debug, I tried to redirect to the https port (30443) with the same result

To debug, instead of redirecting to next cloud container, I directed to the configuration page os the nas. It works and there's no certificate error.

Tried yet with another container running another app. When I connect directly to it, I can access it, when I do so through the reverse proxy, I get the same error.

Did another test, the redirection now was to the web station (80) and it also worked.

It seems that the redirections are not working with the containers. Is there any setting to fix this?

Thanks
 
Bash:
docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a
copy result here for the nexcloud and MariaDB containers

then copy here the RP screenshots
 
here is the result

Code:
# docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a
CONTAINER ID   NAMES                    PORTS
29120154830e   nextcloud-web            0.0.0.0:30080->80/tcp, 0.0.0.0:30443->443/tcp
b260a97ce572   linuxserver-mariadb1     0.0.0.0:33307->3306/tcp
 
Still, one Q is unanswered:
Are you able to run the Nextcloud web (admin account and db config first page)?
nextcloud-final-1.png



Check by browser:
http://NAS_LAN_IP:30080
? result here
http://NAS_LAN_IP/nextcloud:30080
? result here

----------------------------------------------

Just to be sure:
I have http redirected to https, it won't let me in with http
did you mean redirection at (DSM7):
Control Panel > Login Portal > DSM, tick Automatically redirect HTTP connection to HTTPS for DSM desktop
... because this redirection has nothing to do with your containers. It is just for your DSM defined ports (http/https).

------------------------------------------------------

Copy here your /config/config.php (within the nextcloud container)

PHP:
<?php
$CONFIG = array (
  'instanceid' => 'oc8c0fd71e03',                   # hide this item value within ''
  'passwordsalt' => '515a13302a6b3950a9d0fdb970191a',         # hide this item value within ''
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'your NAS LAN IP',   #defined by you in ENV GUI, or manually here
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
   'version' => '7.0.2.1',        
  'dbname' => 'nextcloud',  
  'dbhost' => 'localhost',      
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_carla',          # hide this item value within ''
  'dbpassword' => '67336bcdf7630dd80b2b81a413d07',         # hide this item value within ''
  'installed' => true,
);
 
Hi

Thanks for the patience...

http://NAS_LAN_IP:30080
auto changes to https:// and
Capture.JPG


http://NAS_LAN_IP/nextcloud:30080
Doesn't change but:
Capture.JPG


I can only access the page using:
https://<myip>:30443/nextcloud
or
https://<myself>.synology.me:30443/

Capture.JPG


did you mean redirection at (DSM7):
I'm not sure where it's being done, because when this started I looked where to undo it but it still does it:


Capture.JPG


The config file:
cat nextcloud/nextcloud-web/config/www/nextcloud/config/config.php

Code:
<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'oc4txs9qzi1d',
  'passwordsalt' => 'mypassword',
  'secret' => 'mysecret,
  'trusted_domains' =>
  array (
    0 => 'myself.synology.me:30443',
  ),
  'dbtype' => 'mysql',
  'version' => '23.0.0.10',
  'overwrite.cli.url' => 'https://myip:30443',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'myself.synology.me:33007',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
);

I replaced the private stuff
 
so we finally have last step to cleaning of your setup mess:

config.php
1. in the trusted domains you still don’t have entry of your NAS_LAN_IP (no need port). Just add new row as was recommended two times.
Reason why you can’t access http over LAN IP is in the row:
0 => 'myself.synology.me:30443',

2. Reason why you aren’t able connect to DB:
'dbhost' => 'myself.synology.me:33007',
… you need use localhost instead

So repair the step No.1.
Then connect to the initial Nexcloud Setup
page
1642015202945.png


and put there correct entries as was defined in n the guide:
1642015326560.png

otherwise you can’t start the Nexcloud in normal view.
 
Last edited:
Hello

sorry about that, but I wrote it on the environment variables, don't know why it wasn't there.

I deleted everything and started over.

the config.php file:

Code:
<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => '<replaced>',
  'passwordsalt' => '<replaced>',
  'secret' => '<replaced>',
  'trusted_domains' =>
  array (
    0 => '192.<replaced>:30080',
  ),
  'dbtype' => 'mysql',
  'version' => '23.0.0.10',
  'dbname' => 'nextcloud_db',
  'dbhost' => '192.<replaced>:3307',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'overwrite.cli.url' => 'https://192.<replaced>:30080',
);


I've tried to write the trusted domains without the port, but it gets rewritten when the container starts
I added localhost to trusted domains, it gets deleted and keeps only the ip
Tried using the the domain instead of ip, it replaces the ip in the trusted domains for the domain (<replaced>..synology.me:30080)
tried to remove overwrite.cli.url but it get re added
tried with localhost:port for the database location and I get this error:

Capture.JPG


tried ip:port
I get a timeout error

I am writing the file:
nextcloud/nextcloud-web/config/www/nextcloud/config/config.php

Am I writing the wrong file?
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top