Using NC with ddns

Hi
Im using dynu ddns service.
It will let me get to my home ip. Then with different ports i can get to different apps i have.

How can i configure nc to use my domain and not my ip address?

somewhere in the web server conf file you’ll find a “listen” or “servername” setting.
and nc is configured in config/config.php in the nc folder.

not knowing your web server (nginx/apache) it’s difficult to be more precise.

I think i have nginx. When i see timeout screen so its by nginx

somewhere in the conf files in /etc/nginx/ you’ll find something like

server {
server_name <ip-or-fqdn>;
listen 80 default_server;
location ^~ /.well-known/acme-challenge {
proxy_pass http://127.0.0.1:81;
proxy_set_header Host $host;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
server_name <ip-or-fqdn>;
listen 443 ssl http2 default_server;
root /var/www/nextcloud/;

if you don’t know which file it is: grep -r server_name /etc/nginx.
if you don’t find this entry it’s also fine. that means nginx will answer all request to port 80/443. (in this case grep -r listen /etc/nginx

in /var/www/nextcloud/config/config.php you should find

  'trusted_domains' =>
  array (
    0 => '<ip-or-fqdn>',
  ),
  'overwrite.cli.url' => 'https://<ip-or-fqdn>',

the trusted_domains array as to extend by 1 => '<your-internet-fqdn>', and the overwrite.cli.url has be changed to your internet fqdn.

here https://www.c-rieger.de/nextcloud-installation-guide-debian/ you’ll find an excellent howto configure nc.

(which howto did you follow? or are you using snap?)

I installed nc on omv using docker and followed a youtube video by thecho dad life

Ill check what you suggested and report.

are you using the openmediavault thing? with linuxserver/nextcloud?

then i think you only have to edit the config.php file. the nginx conf file is in the container. and so doesn’t contain your server name or ip.

Exactly.

So where is this file and what i need to change?

In the trusted domains i added my domain so now i can type my domain and access it but when the ip will change will it still work?

which of the two?

for the external ip you use a dyndns. that should do the trick.

Ohhh ok so i already added my domain to the trusted domains.

without the need to set a cronjob to update the ip automatically?