Reverse Proxy - Nginx, Traefik, LetsEncrypt, DuckDNS, ... I am lost!

  • Hi,


    I am lost... I am trying to understand reverse proxy for two weeks and use it on my OMV server, but I am literally lost... ?(


    On my server, I have NextCloud and Home Assistant which can be access from the outside, with two different DuckDNS address. I have three more docker container that I would like to access from the outside, and I would like to make a better configuration.
    For my OMV setup, I have followed the TechnoDadLife tutorial on his YouTube Channel, and videos are really fabulous. But I haven't found any detailed video which explain how to configure correctly a reverse proxy (even both NextCloud video on that topic, but with no example, I haven't understand anything...). I think a dedicated video to this subject could be a nice thing. <3


    Come back to my setup. I have DuckDNS and LetsEncrypt which are running on a docker container. Both have been configured with the NextCloud tutorial. So, I have two DuckDNS adress to access both NextCloud and HomeAssistant :

    • NextCloud : nextcloud.duckdns.org
    • HomeAssistant : home.duckdns.org

    If I understand the utility of reverse proxy, I could use only one DuckDNS address ? Is that correct ?

    I would like to access, for example, to two more services :

    • AirSonic
    • CloudCommander

    Could you explain how I should setup OMV, which container or plugin should I install, how to choose the addresses to access to these services ? :thumbup: Should I use Nginix pluggin on OMV, a specific container, Traefik ?


    Or if you know a specific detailed tutorial about this subject ? I haven't find any tutorial which explain that with DuckDNS addresses...


    Thanks for your help! 8o

  • If you have the letsencrypt docker running with valid certificates you are already close to the solution!
    There is a reverse proxy (nginx) already build into the letsencrypt container.


    But you should better setup your letsencrypt container following the newer vid by @TechnoDadLife https://www.youtube.com/watch?v=pRt7UlQSB2g


    Then you can have multiple sub-subdomains (e.g. nextcloud.mysubdomain.duckdns.org, home.mysubdomain.duckdns.org, airsonic.mysubdomain.duckdns.org and so on...) which point to your different services. And you only need to have the ports 80 and 443 open on your router.



    To change the configuration of the reverse proxy you have to edit the *.conf files in the appdata/letsencrypt/nginx/proxy-confs/ folder. Also the _readme file in the aforementioned folder and the info-page of the letsencrypt container are helpful here.



    Also these threads deal with this topic: https://forum.openmediavault.o…-encrypt-DynDNS/?pageNo=6 https://forum.openmediavault.o…oxy-Letsencrypt-Heimdall/ https://forum.openmediavault.o…nfigure-Remote-Nextcloud/

  • Thanks for your answer.


    So I have followed the TechnoDadLife tutorial for Lets encrypt.


    For NextCloud, I have rename the nextcloud.subdomain.conf.sample file without the .sample, and editted the server name as nextcloud.mysubdomain.*; ?



    After that, I have editted the nextcloud conf file with nextcloud.mysubdomain.duckdns.org.


    Is that the correct way to do that? It worked for fex minutes, but after rebooted my omv server, https://mysubdomain.duckdns.org/ give me an ERR_CONNECTION_REFUSED error, and I don't understand why...


    Thanks for your help!

  • Here is my LetsEncrypt log :


  • Yes, as specified in the TechDadLife video, I have setup the port 80 to 90 and 443 to 450.

    please post your router setup to verify this, and say what is your NAS IP

  • I have reinstalled the LetsEncrypt docker container, and it is working again for NextCloud. Maybe I do something wrong, but I don't remember what.


    Then, I tried to do the same thing for HomeAssistant (Hass.io). So I have edited the homeassistant.subdomain.conf file as following :

    But I have a 502 Bad Gateway error when I try to access to hassio.mysubdomain.duckdns.org.


    Another question, as we have configured the letsencrypt docker container, is the duckdns container is usefull ?


    Thanks

  • Yes, because it updates your ip for the dyndns if it should change due to a reconnect.
    In your config files try changing the server_name to hassio.*; instead of hassio.mysubdomain.*;. Also is your homeassistant docker in the same docker-network as letsencrypt and named homeassistant (as in line33: set $upstream_homeassistant homeassistant; ?

  • Yes, because it updates your ip for the dyndns if it should change due to a reconnect.In your config files try changing the server_name to hassio.*; instead of hassio.mysubdomain.*;. Also is your homeassistant docker in the same docker-network as letsencrypt and named homeassistant (as in line33: set $upstream_homeassistant homeassistant; ?

    I don't understand your last sentence, here is my LetsEncrypt docker container setup :


    And my homeassistant docker container setup

  • nevermind. Did not know that homeassistant is running in host mode. Therefore (someone correct me if im wrong) your should enter the ip adress of your omv machine after the http:// instead of $upstream_homeassistant

  • For airsonic, I put my local ip address in the airsonic conf file (last line) :



    And it is working great, however, I don't know if it is the correct way to do that!


    For Heimdall, I have done the same thing :



    But it doesn't work... Maybe because of the 443 port that I have replaced by 8081 ?

  • Thanks for your help, I have finally understood the principle of reverse proxy.

    It took me few days, that why I answer only now. I have made a fresh install of Openmediavault and I have confirmed all my services with reverse proxy.

Jetzt mitmachen!

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