NextCloud Local Access not working. LocalDNS setup already, but still struggling to point to the port

  • Hi There


    Defining some Terminology in advance...

    • ServerAddress => place holder for my server's ip address
    • NextCloudPort => port I can use with ServerAddress to get into Nextcloud e.g. https://ServerAddress:NextCloudPort
    • sharing.duckdns.org => example of my nextcloud website


    After following TDL video on setting NextCloud Remotely, I managed to get it to work. Can access remotely with certification.


    However, like some people, local access bombs out. (Not exactly sure of the reason, but it seems like it's trying to go to my wan ip instead of redirecting it locally to ip)


    Researching online, the solution is to either try edit your host file to point sharing.duckdns.org to ServerAddress or to use a LocalDNS and point sharing.duckdns.org to ServerAddress.


    So, I setup a LocalDNS using DNSMASQ (built in plugin), and mapped sharing.duckdns.org to SeverAddress. But that will only take you to the landing page of the WebGUI of OMV.


    I've been trying to mess around with my settings so that I can get sharing.duckdns.org to point to ServerAddress:NextCloudPort.


    Does anyone know what I should do?


    (This is my first post, so if I'm missing any important information, I apologise in advance)


    Thanks!
    Yoyo

  • So before setting up the LocalDNS, it would try go to my WAN address and just not work. I think reading around, it's called DNS Loopback?


    After setting up the LocalDNS, and then pointing sharing.duckdns.org to ServerAddress, it would go to the WebGUI for OpenMediaVault (OMV)

  • My assumption is that I need to do something with my router / firewall to try get it to work. Like mapping port 80 to port NextCloudPort. (port-forwarding?)


    Or... "reverse proxy with nginx" (something that I read online), but almost have no idea right now how that works.

  • Externer Inhalt www.youtube.com
    Inhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.
    Durch die Aktivierung der externen Inhalte erklären Sie sich damit einverstanden, dass personenbezogene Daten an Drittplattformen übermittelt werden. Mehr Informationen dazu haben wir in unserer Datenschutzerklärung zur Verfügung gestellt.


    This is the one I followed. So just to re-iterate, after following this guide it works. But just not locally. (And then I did the localdns which I mentioned above)

  • It is normal that you don’t reach it via the local address afterwards, because your request will be redirected through the cli.override command.
    But when I’m in my home LAN, the connection through by dyndns address works.

  • OKAY. After many trial and errors, I managed to work get it to work via nginx reverse proxy. (if someone may be so kind to explain how it worked, I would greatly appreciate it)


    For those who encounter something similar i.e. their router doesn't support NAT Lookup

    • This is only for people who followed TDL video and can connect to their nextcloud container remotely, but can't connect using their local area network.
    • Ensure that you have setup up a local dns OR edit your host file and map sharing.duckdns.org to your server address.
    • I remapped my OMV WEBGUI port away from port 80 (e.g. can be like port 82 or 81 etc) [TBH, not sure if I needed to do this or not. I just didn't want to block myself out if I messed up]
    • Then ensure you have allowed SSL connection under "General Settings" and keep the default https port 443.
    • then I used the nginx plugin in OMV4, to setup a server to perform the reverse proxy. The below is the configuration I used.





    And then in the extra options box (which I got from this link https://forum.openmediavault.o…5108-nginx-Reverse-proxy/). Thanks @Havoc and @antipiot)


    Code
    location / {
        proxy_headers_hash_max_size 512;
        proxy_headers_hash_bucket_size 64;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        add_header Front-End-Https on;
        proxy_pass https://sharing.duckdns.org:NEXTCLOUDPORT;
    }


    And BAM. you can now nextcloud locally and remotely, using sharing.duckdns.org


    Happy to try assist noobs (like me) who are struggling to get this to work :D

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!