Swag Nextcloud Docker reach internal IP

  • Hi all,


    I configured my Nextcloud docker container with Swag and DuckDNS following these Techno Dad Life videos:


    Video 1:


    Video 2:


    Everything is set up and working fine when I connect via the public URL. However, after setting up Nextcloud in the local network only (video 1), I was able to reach Nextcloud on its local IP (192.168.0.101:444). After installing Swag and DuckDNS (video 2), the local IP will give me ERR_CONNECTION_REFUSED.


    The issue is that now whenever I upload something from my local PC, it is apparently routed through the internet, which is slow and unnecessary.


    Does anybody know if it is possible to make local IP and public URL working at the same time (and how to configure this)? Or any other way to prevent the local traffic from being routed through the internet?


    Thank you in advance!


    Cheers

  • I have not seen the videos. But here you have a guide to configure the same and a thread with all the answers.

    [How-To] Nextcloud with swag (Letsencrypt) using OMV and docker-compose

    Nextcloud with Letsencrypt using OMV and docker-compose - Q&A

    That video is over three years old. There will probably be some outdated things.

  • You really need to move to OMV5, or even 6. This Nextcloud how-to is the going method currently: [How-To] Nextcloud with swag (Letsencrypt) using OMV and docker-compose

    Easy data backup: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV 5 (current) - Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, Wetty, & Heimdall - NanoPi M4 (v.1): backups using Rsync and Rsnapshot - Odroid XU4 (Using DietPi): PiHole - hc2, xu4, Pi 3B+, Odroid H2, and VirtualBox: Testing and playing - Mac user converting to Linux, Debian 10 KDE.

  • Posting to watch the thread.

    Will reply when I manage some free time

  • I think we ran the op away. We didn’t tell him what he wanted to hear.

    Easy data backup: In a Scheduled Job: rsync -av --delete /srv/dev-disk-by-label-SOURCE/ /srv/dev-disk-by-label-DESTINATION/ (HT: Getting Started with OMV5)
    OMV 5 (current) - Thinkserver TS140, Nextcloud, Plex, Airsonic, Navidrome, Ubooquity, Digikam, Wetty, & Heimdall - NanoPi M4 (v.1): backups using Rsync and Rsnapshot - Odroid XU4 (Using DietPi): PiHole - hc2, xu4, Pi 3B+, Odroid H2, and VirtualBox: Testing and playing - Mac user converting to Linux, Debian 10 KDE.

  • Have not watched the vidoe, but you can try to add two seperat reverse-proxy configigurations pointing to nextcloud.

    If yoiu have a local DNS, you can easily add a name insead of choosing a different port.

    If you got help in the forum and want to give something back to the project click here and write up your solution for others.

  • Have not watched the vidoe, but you can try to add two seperat reverse-proxy configigurations pointing to nextcloud.

    If yoiu have a local DNS, you can easily add a name insead of choosing a different port.

    The issue is on the rewrite of the config.php that belongs to Nextcloud.

  • So the only option is to have the internal DNS overrider the public DNS-Name and point it to the internal IP.

    If you got help in the forum and want to give something back to the project click here and write up your solution for others.

  • First of all, thank you for your responses and sorry for my late reply. Somehow I thought I'd get email notifications - doesn't seem to be the case :D


    I will try to re-configure the DNS accordingly. I keep you posted about it. I hope to be able to make some time during the holidays.


    Of course, long-term there'll be no way around upgrading.

  • So after contemplating I believe there's no way to manage this in my current setup. The issue is that calling the new external port (450) directly leads me to a default page of Swag. I suppose Swag behaves this way to prevent bypassing the proxy (blocking anything that doesn't come via DuckDNS), so it's a security feature that I definitely don't want to switch off.


    Until upgrading one day (or until someone comes up with an awesome solution ;) I will live with it.

  • So after contemplating I believe there's no way to manage this in my current setup. The issue is that calling the new external port (450) directly leads me to a default page of Swag. I suppose Swag behaves this way to prevent bypassing the proxy (blocking anything that doesn't come via DuckDNS), so it's a security feature that I definitely don't want to switch off.


    Until upgrading one day (or until someone comes up with an awesome solution ;) I will live with it.

    I solved it by installing a DNS server on my router. That way I access Nextcloud from LAN with the domain.

  • Very easy...


    You need a port for OMV in your docker-compose/stack/whatever you're using in OMV... If you follow below, Nextcloud will be available by subdomain (nextcloud.yoursubdomain.duckdns.org) or by ip (https://ip:450)


    RE: Nextcloud Bad Gateway


    Near the end where I put the "this is optional" step to comment out port 450... just don't do that, and you'll have unsecured local access and secured remote access. (but you do need to consider upgrading.. OMV 4 has been EOL for a while)

    Air Conditioners are a lot like PC's... They work great until you open Windows.


  • Thanks again for your responses.


    chente

    Quote

    I solved it by installing a DNS server on my router. That way I access Nextcloud from LAN with the domain.

    Unfortunately this is not possible with my router. And even if – I assume I would just see the SWAG default page again (same as when calling 192.168.0.101:450 directly).


    KM0201

    Quote

    Near the end where I put the "this is optional" step to comment out port 450... just don't do that, and you'll have unsecured local access and secured remote access.

    I remember, this is what I tried in the very beginning, as well. I'm using an OMV Docker plugin, i.e. I have a GUI where I configure the port forwardings (see screenshot with 444 as an example). However, whenever I try to set a port forwarding rule for the nextcloud container and click "+" and "Save" it is just ignored. Probably this is the actual problem :/ The docker logs for this container don't show any errors.


  • Unfortunately this is not possible with my router

    If you can't do it on your router you can do it by configuring a DNS server in OMV.

    And even if – I assume I would just see the SWAG default page again (same as when calling 192.168.0.101:450 directly).

    You would see the service because it would enter through Swag on port 443.

  • it's been ages since I used that plugin



    444:443 needs to be in the letdencrypt container (that looks like the nextcloud section). 450:443 needs to be in the nextcloud portion

    Air Conditioners are a lot like PC's... They work great until you open Windows.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!