Simple fast daemon host webgui access [Nginx]

    • OMV 1.0

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Simple fast daemon host webgui access [Nginx]

      This is the Questions / Problems / Diskussions Thread for the following guide:
      Daemon webUI access through prefix/hostname [Nginx] [Proxy_pass]
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server

      The post was edited 2 times, last by WastlJ ().

    • Hi,

      Nice guide! I've tried to use it to get plex, couchpotato, sickbeard to be accessed on mydomain.com/sickbeard etc instead of mydomain.com:8081. Should I write just couchpotato instead of "sb.lan" or what does the .lan point to?

      How do I restart the deamon?

      This part I don't understand, care to explain more?
      ​The custom dnsmasq entries can be setup in openwrt in the /etc/config/dhcplist address '/sb.lan/10.10.10.12'
      list address '/sb.lan/10.10.10.12'
      That ip address is the static for OMV.
    • .lan is a custom local domain, sometimes people use .local or whatever they want. This is configured in the router to provide domain for everyone inside the LAN.

      nginx daemon restart is /etc/init.d/nginx/ restart

      This part I don't understand, care to explain more?


      Imagine I have several PC's in my lan, how do they will know how to reach sb.lan or cups.lan that is located at my OMV? They need to refer to a local DNS resolver, so you need to point that address into an ip address. Each browser is going to consult the address first in the local DNS server (typically 192.168.1.1). This only happens if your router is setted to intercept all DNS traffic. In this case openwrt is a router with a 3rd party firmware.
      If by chance you don't have a router which you can add dns entries, you can point the address in each PC by editing the host file (windows, mac, linux)
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • WastlJ wrote:

      @subzero79 - do you mind if I will move and format your first post into the Guides Section and leave this thread as the discussion thread?


      Fine by me. I would change the title and add some screenshots (of browser url bars) for people to understand whats the purpose.
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • So I don't have to configure the nginx plugin? I just interact with nginx via command line inputs? What about the DNSmasq plugin? What is that for? Do I have to do anything there?

      I appreciate the guide. I am novice here, but i'd really like to get this working. =)

      Thanks,
    • Coru, I'm not sure if you understand it correctly. Apache and nginx are webservers. If you want to host a website it needs to run on a webserver. OMV's pages run on nginx. Anything you access via http/https with a browser is being hosted by a webserver. Is there something you want to run that needs to have web pages hosted by a webserver????

      If you do not need to host a website, or use a non plugin package that needs to host a website, you do no need this plugin.

      The post was edited 1 time, last by tekkb ().

    • Congrats Subzero, nice guide. Well explained but I can't figure out how to proxy_pass my OpenVPN login page (running on port 943) to mydomain.no-ip.org/VPN/

      I also tried to serve my Wordpress site from the Nginx plugin on another port different from the 80 (of the OMV web interface) to be able to "close" the web interface to the public so they could only access the wordpress site when typing mydomain.no-ip.org/blog/ for example.

      Thanks in advance.

      EDIT: following your shellinabox example, my multi_host file should look like this, or not?

      Source Code

      1. #OpenVPN
      2. server {
      3. server_name gsola96.no-ip.org;
      4. listen [::]:80;
      5. location /VPN/ {
      6. proxy_pass http://localhost:943;
      7. }
      8. }



      Guillem
      DISCLAIMER: :!: I'm not a native English speaker, I'm sorry if I don't explain as good as you would want. :!:

      My NAS:
      Always the latest OMV Erasmus running on an AMD Sempron 3850 @1.3GHz with 4.9.0 Backports Kernel
      with 120GB Samsung SSD 850 EVO for OpenMediaVault & 2x500GB Primary Data HDD + 1TB Secondary HDD for Backup & 2TB USB 3.0 External HDD for offline backup

      Plugin list:
      Flash Memory, Locate, OMV-Extras.org, RSnapshot, Sensors, Syncthing, SMB/CIFS, SSH, USB Backup
      _____________________________________________________________________________________________________________________________

      The Schrödinger's code is that one which is going to work and it's full of bugs at the same time; until you test it, you won't be able to determine it.
    • The guide is intended for domains only not url. What you want to do is probably possible but I have no idea how to do it.
      If you want some references of this look at the Mysql plugin and virtualbox plugin. Both implement a webui access through an url extension like ip/virtualbox and ip/mysql.
      I think also sickbeard plugin does the same.
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • @gsola96

      Create this file:
      cd /etc/nginx/openmediavault-webgui.d/
      touch openmediavault-openvpnas.conf
      chown root:root openmediavault-openvpnas.conf
      chmod 644 openmediavault-openvpnas.conf

      Then put in these contents:

      Source Code

      1. location /VPN {
      2. return 301 https://$host:943/;
      3. }


      Then restart nginx.... a simple redirect is all you need. Access via https... you know it is secure.

      PS- Remember Chrome is not supporting java. You need to use IE.

      The post was edited 1 time, last by tekkb ().

    • Thanks Subzero and Tekk. So, from what I understand, this simple redirection could be implemented the same way to access Subsonic on port 2000 like this:

      Source Code

      1. location /subsonic {
      2. return 301 https://$host:2000/;
      3. }


      Am I right? Does that mean that I could access also the same way (using subdirectories) from a WAN outside my home LAN?

      EDIT: according to @subzero79, his guide is to be used with subdomains (sb.lan, whatever.lan) so, if I have a free domain gsola96.no-ip.org, if all the computers in the LAN have this domain (the entire gsola96.no-ip.org), could I then follow subzero's guide?


      Thanks for your attention. That's what makes OMV big!
      DISCLAIMER: :!: I'm not a native English speaker, I'm sorry if I don't explain as good as you would want. :!:

      My NAS:
      Always the latest OMV Erasmus running on an AMD Sempron 3850 @1.3GHz with 4.9.0 Backports Kernel
      with 120GB Samsung SSD 850 EVO for OpenMediaVault & 2x500GB Primary Data HDD + 1TB Secondary HDD for Backup & 2TB USB 3.0 External HDD for offline backup

      Plugin list:
      Flash Memory, Locate, OMV-Extras.org, RSnapshot, Sensors, Syncthing, SMB/CIFS, SSH, USB Backup
      _____________________________________________________________________________________________________________________________

      The Schrödinger's code is that one which is going to work and it's full of bugs at the same time; until you test it, you won't be able to determine it.

      The post was edited 2 times, last by Lord Wektabyte ().

    • Redirects are good for when you are on your LAN, or when connected with a VPN connection. I thought you might not want to remember your ports numbers and have an easy name to remember. I don't think it is a good idea to open very many ports. I use OpenVPN to connect to my LAN and then I can use local addresses. Proxy passes are used to connect you to a domain and then pass you to subdomain (another site). You can use proxy passes but if they are not perfect parts of the website may not work correctly. You do not have to worry about all the hosting parameters with a redirect, especially if a service is self hosting and sets up it own web server.

      There are so many variables involved here and so much to learn. You cannot make a blanket statement on what is best.
    • Ok, now I have learned a bit more of all that stuff.

      tekkb wrote:

      I use OpenVPN to connect to my LAN and then I can use local addresses.

      By the way, I also use VPN to connect remotely because I'm also pretty paranoid about opening so much ports... At the moment I have only 4 ports of OMV opened to the world: the VPN, owncloud (to be able to connect from everywhere without needing the VPN), a public FTP site, and the 80 for my public wordpress side.
      Regarding that this last port is the 80 and opens the web interface to the world, are there any workaround to deny access to the root directory (in this case gsola96.no-ip.org) and only leave open the /wordpress/ subdirectory?

      Maybe this last question is Off-Topic but I would like the world not to be able to access the webGUI. Maybe changing the root directory to the wordpress site and leaving /whatever/ for the GUI... Don't know much about that :(
      DISCLAIMER: :!: I'm not a native English speaker, I'm sorry if I don't explain as good as you would want. :!:

      My NAS:
      Always the latest OMV Erasmus running on an AMD Sempron 3850 @1.3GHz with 4.9.0 Backports Kernel
      with 120GB Samsung SSD 850 EVO for OpenMediaVault & 2x500GB Primary Data HDD + 1TB Secondary HDD for Backup & 2TB USB 3.0 External HDD for offline backup

      Plugin list:
      Flash Memory, Locate, OMV-Extras.org, RSnapshot, Sensors, Syncthing, SMB/CIFS, SSH, USB Backup
      _____________________________________________________________________________________________________________________________

      The Schrödinger's code is that one which is going to work and it's full of bugs at the same time; until you test it, you won't be able to determine it.