NGinx reverse proxy when changing OMV port?

  • Hi,


    Right now I use port 80 and 443 with forced SSL for accessing my OMV admin pages outside my network. This works great, and I have setup my different plugins with reverse proxy to be able to access CouchPotato, Sonarr, Transmission etc.


    To access sonarr I go to: sonarr.XXX.com (which really transfers me to omv.XXX.com/sonarr/).
    My reverse proxy looks like this:

    Code
    location /sonarr/ {
    proxy_pass http://localhost:8989;
    include /etc/nginx/openmediavault-webgui.d/proxy.conf;
    }



    The included conf looks like this:


    Code
    proxy_redirect off;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


    What I want now is to set my webserver to port 80 and 443 to use my server as a Wordpress host. I have set the OMV settings to port 81 and port 444 which means I can access my Wordpress via my domain. I can also access OMV and plugins when visiting omv.XXX.com:444/sonarr/.
    What I want to do now is the still be able to visit my OMV admin and plugins without the need of the port number.


    So how do I rewrite my NGinx Reverse proxy I posted to make sure that I can reach my OMV admin and Plugins without writing the port number?


    Thank you in advance!

  • Hello,
    i think i got the same problem.
    proxy_pass can be used as to any other site


    The Problem seems to be that there are links to the root directory in omv htmlcode (like "src='/extjs/...'")
    So the server would search that in his local root directory.
    Got the same Problem for other websites i'd like to use behind nginx as reverse proxy.


    Maybe there is a solution with using "ngx_http_sub_module".
    But i'm not sure at this moment.

  • Sorry of doubleposting.


    The solution was to use substitutions instead of the ngx_http_sub_module. May work too but is not included in the nginx package of omv


    This configurtation is working for me:


  • Thank you for your reply. Sadly this gives me an error:
    Restarting nginx: nginx: [emerg] unknown directive "subs_filter_types" in /etc/nginx/openmediavault-webgui.d/omv.conf:3
    nginx: configuration file /etc/nginx/nginx.conf test failed


    I can't figure it out.


    After you made this work, how did you manage to give your NGinx websites the correct redirect?

  • Hi,
    should work. It just works for me (but i modified the filters above. Just look again)


    What version of omv are you running? I'm running OMV3. You can check if sub_filters is compiled when calling nginx -V via SSH
    There should be the ngx_http_substitutions_filter_module


    Another error can be a simple "copy and paste error"

    It sounds like you did some copy and paste work here. It's not uncommon to snag some extra characters that are invisible at the end of line (EOL). Try this:
    Run your text through this tool: http://www.textfixer.com/tools/remove-line-breaks.php
    then fix any breaks that may have been removed and will be affected by the comments.
    This worked for me. Hope it works for you.

  • Hi,
    should work. It just works for me (but i modified the filters above. Just look again)


    What version of omv are you running? I'm running OMV3. You can check if sub_filters is compiled when calling nginx -V via SSH
    There should be the ngx_http_substitutions_filter_module


    Another error can be a simple "copy and paste error"

    I did try nginx -V, this is the result:


    No ngx_http_substitutions_filter_module, but I understand you have to install this module? Though I can't make it work via the instructions on the NGinx module site. How did you do it?

  • Using the above code worked pretty good, however the Enable/Disable icons and various other items (checkboxes, radio-buttons, etc.) do not display. How did you work around this issue? The webgui only is quasi functional without these things :(.

  • Correct config for nginx proxy_pass and Letsencrypt subdomain (you must use an nginx plugin).


    If you want to use different port in nginx use this additional param (your page was in url https://sub.domain.com:15021:(



  • Did anyone get this to work succesfully?


    I would like to have my omv-gui running on: https://mydomain.com/openmediavault
    It is currently running on https://127.0.0.1:2443 and http://127.0.0.1:2080


    I tried installing the nginx substitutions module, but this requires removing the current installation, which I didn't dare to do. I did not understand g2_ufo's configuration, since his one seems to redirect to a different port (15021) with another server?


    If anybody has some suggestions, they are very much appreciated!

  • I am using name based ssl reverse proxy.


    What you need:


    1) LetsEncrypt domain name like 1.mydomain.com , 2.mydomain.com and etc
    2) nginx plugin with config:
    2.1) host type: name-based
    2.2) server name: 1.mydomain.com
    2.3) enable ssl and set port (for examle 40030) and set "only use ssl"
    2.4) add extra options like:




    http://127.0.0.1:5555 - it is one of your service (for example piwigo running in docker). Use different ports for different services.


    And now all your service would be acceccible via one port but with diffents hostname:


    https://1.mydomain.com:40030 - one service
    https://2.mydomain.com:40030 - second service...



    Exeption: in nextcloud conf file need to add



    Code
    'trusted_domains' =>
      array (
        1 => '1.mydomain.com',
      ),
    'overwriteprotocol' => 'https',
    'overwritehost' => '1.mydomain.com:40030',
  • Hello, I’m facing the same error than Zalaare (no check box). However the substitution module is a good start, it can solve many problem. But i'm not verry good at http /css things so my skills stops me here. If somehone can help.



    Does anyone put the OMV-webui behind areverse proxy ? it's practical when you want to distributeseveral applications.

  • I also tried to get it working, but without luck. Apparently Sickbeard plugin has this option available in OMV GUI and it works for Sickbeard and Sickrage, when I tried to adapt the code for anything else it is not working well.

Jetzt mitmachen!

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