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
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
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
From there let’s put our first entry for sickbeard:
Let's add Cups
Display All
transmission daemon
Display All
Once were finish, nginx will read the file from sites-enabled folder, so for that:
Then we restart the nginx daemon
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
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:
Linux and Mac OS X:
There we can add a line like this line:
example:
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
Display Spoiler
Display All
EDIT: For omv 3.0 onwards we should add an additional listen line for each block, so for example for sonarr
Display All
Questions / Problems / Diskussions
Click HERE to get to the discussions thread.
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 settingsnano /etc/nginx/sites-available/multi_host
From there let’s put our first entry for sickbeard:
Let's add Cups
Source Code
transmission daemon
Source Code
- #transmissiion-dameon
- server {
- server_name td.lan;
- listen [::]:80;
- location / {
- proxy_pass_header X-Transmission-Session-Id;
- proxy_set_header X-Forwarded-Host $host;
- proxy_set_header X-Forwarded-Server $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_pass http://localhost:9091;
- }
- }
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
Source Code
- server {
- server_name docker.lan;
- listen [::]:80;
- location / {
- proxy_pass http://localhost:9200/;
- proxy_http_version 1.1;
- proxy_set_header Connection "";
- proxy_redirect off;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Host $server_name;
- }
- }
EDIT: For omv 3.0 onwards we should add an additional listen line for each block, so for example for sonarr
Source Code
Questions / Problems / Diskussions
Click HERE to get to the discussions thread.
New wiki
chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
telegram.me/openmediavault broadcast channel
openmediavault discord server
chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
telegram.me/openmediavault broadcast channel
openmediavault discord server
The post was edited 18 times, last by subzero79 ().