Daemon webUI access through prefix/hostname [Nginx] [Proxy_pass]

    • Offizieller Beitrag

    Daemon webUI access through hostname/prefix [Nginx] [Proxy_pass]


    Introduction


    Several daemons in OMV have their own webUI running in their own http engine, for example if we want to access Sickbeard we type in the browser URL http://omv_ip:8081/ for transmission-daemon we type http://omv_ip:9091/transmission/web/ and so on.


    This guide is about using the Nginx (default OMV http engine) to make use of proxy_pass which will allow us to use hostnames or local domain prefixes in port 80 to access those services without affecting OMV user interface. This works by redirecting specific domain/hostnames request to the necessary port.
    Now for example if we want to access sickbeard, let’s invent a short name say http://sb.lan (.lan is my local domain pushed to every client by my router LAN dns)


    sb.png


    Cups,
    cups.png


    Transmission,
    td.png



    Pre-Requirements


    OpenMediaVault 1.0
    Also, for this you will require to be in control of your DNS local resolver (dnsmasq let that be in openwrt, tomato or ddwrt) that will allow you to point multiple hostnames or prefixes to one IP in your LAN. If your router can assign multiple hostnames to one ip then is also possible.


    wrt.png


    Setup


    Now let’s get into it, for this will need ssh access console. Let’s create a text file in /etc/nginx/sites-available/, this file will hold our multiple hosts settings


    nano /etc/nginx/sites-available/multi_host


    From there let’s put our first entry for sickbeard:


    Code
    #sickbeard
    server {
        server_name sb.lan;
        listen [::]:80;
        location / {
            proxy_pass http://localhost:8081/;
        }
    }



    Let's add Cups



    transmission daemon



    Once were finish, nginx will read the file from sites-enabled folder, so for that:


    ln –s /etc/nginx/sites-available/multi_host /etc/nginx/sites-enabled/multi_host


    Then we restart the nginx daemon


    /etc/init.d/nginx restart.


    Nginx will cluck for any syntax error, watch for the semicolons at the end of lines in between the curly brackets, if there’s any missing correct.


    console.png


    Please notice that every service/daemon is somehow different depending on how their http server configured. Most of this configurations contributed here were done by trial and error, reading nginx documentation website and some other forums. I am not an Nginx ninja so every person that knows more and wants to contribute with custom settings is more than welcomed.


    The best way to achieve this without a local dns server is to use the syntax http://omv_hostname/sickbeard but I haven't been able to figure it out yet.


    Don’t have a local DNS?


    We can circumvent around this in every client in our LAN that we want to give access by modifying the host file.
    In windows:
    C:\Windows\System32\Drivers\etc\hosts
    Linux and Mac OS X:
    /etc/hosts
    There we can add a line like this line:


    ip_address_OMV hostname_desired


    example:


    10.10.10.12 cups.lan


    In the attachment section you will find a txt file with all daemons settings I use for my OMV. Please feel free to take it an accommodate it to your own needs.


    Edit: added dockerUI in the spoiler below



    EDIT: For omv 3.0 onwards we should add an additional listen line for each block, so for example for sonarr





    Questions / Problems / Diskussions
    Click HERE to get to the discussions thread.

Jetzt mitmachen!

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