Nginx settings on OMV6

  • I've hosted my own websites alongside OpenMediaVault for some time now, first using the nginx plugin on OMV4 and then with plain config files on OMV5. I'm now looking at v6 (great job by the way, very slick) and although I've got things working there I'm a bit puzzled by the differences I'm seeing. These differences are not just between v6 and v5, but also between two v6 installs that I thought I had configured similarly. Presumably there's more going on behind the scenes than I realised.


    In OMV5 the openmediavault-webgui config file contains:

    Code
    listen [::]:80 default_server ipv6only=off;
    listen [::]:443 default_server ipv6only=off ssl deferred;

    These entries are recreated if I disable/enable SSL via the web UI so I assume they don't include any manual hacks that I might have made and forgotten about. My sites work fine alongside the OMV UI with these settings, with everything listening on ports 80/443 but different hostnames set in the server blocks.


    On my OMV6 installation I had these entries:

    Code
    listen *:80 default_server;
    listen [::]:80 default_server;
    listen *:443 default_server ssl deferred;
    listen [::]:443 default_server ssl deferred;

    My sites aren't served with these settings - the OMV web GUI is served regardless of which hostname is used in the requests. If I change to the v5 settings (removing the ipv4 lines and adding ipv6only=off to the ipv6 lines) everything works as before. As the comment in the file makes clear though, such changes can be overwritten, so presumably this is not a good solution. I created another instance of OMV6 to have a poke around with, and was surprised to see that it has different settings:

    Code
    listen 80 default_server;
    listen 443 default_server ssl deferred;

    ... even though I tried (but presumably failed) to keep both instances the same. Presumably there's something else involved in determining the settings to use. Is there some way I could modify those rules to get OMV6 to use the v5 style settings?

  • one of your system has IPv6 enabled and the other not.

    As far as I can see from the web UIs they all have IPv6 disabled. My OMV5 system shows:


    My main OMV6 system (the one that has "listen *:80 default_server" and so on) shows:


    ... and my test OMV6 system (the one that has "listen 80 default_server") shows:

  • I haven't managed to find the cause of the difference in the openmediavault-webgui config files between my two OMV6 machines, as they both seem to have IPv6 disabled. I did however solve the problem that the dropping of "ipv6only=off" was causing me.


    My server blocks previously only had IPv6-style "listen" directives such as:

    Code
    listen [::]:80;
    listen [::]:443;

    It wasn't necessary for the blocks to use IPv4-style listen directives because, if I understand correctly, nginx automatically listened for the corresponding IPv4 addresses. That presumably only applies when the "ipv6only=off" directive was present on the default server though. On OMV6, which doesn't seem to use ipv6only=off, the OMV web UI was being served in place of my sites on OMV6, i.e. regardless of the hostname specified in the request. Explicitly adding IPv4 "listen" directives to each of my other server blocks worked for me:

    Code
    listen 80;
    listen 443;
    listen [::]:80;
    listen [::]:443;

    Hope this might help anyone else landing here with a similar problem.

Jetzt mitmachen!

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