Make a subdomain for Accessing OpenMediaVault Web GUI

  • Hi
    I'm not sure if this has been asked before or whether anyone has thought about doing it, but I would like to set a sub-domain for accessing the WebGUI of OMV. To explain further, I'm setting up Nextcloud inside a Docker container and I would like to keep the default port 80, however, this clashes with OMV's WebGUI also running on that very same port. To be able to run OMV and Nextcloud's web interfaces together, in theory I should be able to run them each on their own sub-domain. For example
    cloud.openmediavault.lan > Nextcloud's Web interface
    admin.openmediavault.lan > OMV's WebGUI
    I know that OMV runs off a NGINX server and it's config file is found at /etc/nginx/sites-enabled/openmediavault-webgui (symbolic link to /etc/nginx/sites-avaliable). Here's the contents of openmediavault-webgui


    server {
    server_name openmediavault-webgui;
    root /var/www/openmediavault;
    index index.php;
    autoindex off;
    server_tokens off;
    sendfile on;
    large_client_header_buffers 4 32k;
    client_max_body_size 25M;
    error_log /var/log/nginx/openmediavault-webgui_error.log error;
    access_log /var/log/nginx/openmediavault-webgui_access.log combined;
    error_page 404 = /404.php;
    location /404.html {
    internal;
    }
    location /extjs6/ {
    alias /usr/share/javascript/extjs6/;
    expires 2d;
    }
    location ~ ^/(css|fonts|js|images)/ {
    expires 2d;
    }
    location /favicon {
    expires 14d;
    }
    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php-fpm-openmediavault-webgui.sock;
    fastcgi_index index.php;
    fastcgi_read_timeout 60s;
    include fastcgi.conf;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    listen 8080;
    include /etc/nginx/openmediavault-webgui.d/*.conf;
    }


    I changed line 1 to > server_name admin.openmediavault.lan;


    added 127.0.0.1 admin.openmediavault.lan to the /etc/hosts file


    and finally rebooted OMV. I could still access OMV via its IP address but the new domain name didn't work. I get a couldn't resolve domain error.


    Is there as easy way of doing this or something I'm missing? I don't mind tweaking with the backend of the OS and using a CLI if needed.


    Maybe as a suggestion for future builds could we get more options added to the General Settings > Web Administration page such as setting sub-domains so that this can be done via GUI.


    Many thanks in advance.


    Will

    • Offizieller Beitrag

    I use plenty of sub domains. For this task i use traefik which acts as a reverse proxy very easy to setup. If you use letsencrypt it can automatically renew the certificates.
    for this to work in the local network a static dns entry that points to a domain using wildcard. I case this is not possible you have to edit the host file on the computer you’re using to access the server.

  • Hi subzero79, I am trying to do exactly what the OP is trying to do but with docker and traefik.


    Basically I have all my containers exposing different ports within the local network with domain fritz.box, i.e.:


    server_name.fritz.box:1234 //music service
    server_name.fritz.box:4321 //photo service
    etc..


    what I am trying to achieve is reaching the servers like this:
    music.server_name.fritz.box
    photo.server_name.fritz.box


    right now I am struggling a lot. Before asking for further help, can you tell me if this is even possible with traefik?
    thanks!

    • Offizieller Beitrag

    Yes should be possible. Need to setup docker as a provider in traefik. Also for each container running you need to supply them with labels that traefik will read so it can route the front end requests properly. For non docker services you need to maintain a separate configuration file to point where the servers are.


    As long as the domains are resolving to the host running docker should work. Please read traefik docs, to see examples and configuration options.

  • Hi Thanks,
    I have done almost everything you said and have my compose file like this:



    but I still cannot manage to connect to netdata.mars.fritz.box


    I am quite struggling at this point..

Jetzt mitmachen!

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