Setting up OMV to run packages via NGINX without using a port number but the IP address of OMV/folder

  • I have wanted to run a number of packages so that all I needed to do was to type in the IP address of the OMV/package_name. I also wanted to run these from a separate drive in my case mapped to /media/www/package_name.


    I struggled with the NGINX configuration but there were clues in the way Mysql is implemented in the NGINX .conf files. I thought I would share what I did and if someone can improve on this great.


    Firstly worth saying I have Webmin installed which helps with the configuration and I have included the NGINX plugin for Webmin.


    OMV stores the config in /etc/nginx/sites-available/openmediavault-webgui. (note NGINX only uses these configurations if there is a symlink from the /etc/nginx/sites-enabled folder.


    If you examine this folder it has at the bottom a line which is
    include /etc/nginx/openmediavault-webgui.d/*.conf;


    So this indicates we can include additional configurations in the folder /etc/nginx/openmediavault-webgui.d. And sure enough there is one for Mysql - openmediavault-mysql-management-site.conf.


    The PHP sock is in this line
    fastcgi_pass unix:/var/run/php-fpm-openmediavault-mysql.sock. And you can see the shortcut to the file if you take a look in /var/run. The actual PHP config are held in /etc/php/7.0/fpm/pool.d.


    This is important as I did not want to change the openmediavault-webgui.d so any future changes to OMV would not overwrite my changes.


    These pool.d files are written using the NGINX plugin in OMV. So if you add a Pool via the NGINX plugin it creates the pool.d folder file after first writing the config to the /etc/openmediavault/config.xml. See more about this here https://openmediavault.readthe…opment/internaltools.html


    So I figured that I could use the NGINX plugin to create the pool.d files and the associated symlink in /var/run and create my own nginx .conf files in /etc/nginx/openmediavault-webgui.d folder by copying the openmediavault-mysql-management-site.conf and altering the link to the .sock file. i.e. changing the line fastcgi_pass unix:/var/run/php-fpm-openmediavault-mysql.sock. to fastcgi_pass unix:/var/run/my_new_nginx_name.sock in the copied file.


    I successfully added
    1. Wordpress
    2. Nextcloud
    3. Piwigo
    4. Firefly
    5. Webtrees
    6. Extplorer


    The config was slightly different for each one and Webtrees was particularly tricky for me and the URL was changed to have the server "openmediavault-webgui" in the file /etc/nginx/sites-available/openmediavault-webgui replacing the url after https://openmediavault-webgui/webtrees which messed by everything. More on Webtrees lower in the post.


    So for Wordpress the NGINX .conf file is (similar for Piwigo and Extplorer and Webtrees)




    Next Cloud - harder as needed to use root and not Alias



    Firefly




    So the fix needed for Webtrees was to have another Server block which was not the same as that here /etc/nginx/sites-available/openmediavault-webgui.


    So I copied this file and renamed as a new file matching my site URL.


    Added a symlink from /etc/nginx/sites-enabled


    Inside the new file I needed to change a few lines .....




    The Firefly .conf file was then moved to /etc/nginx/my_new_url_file.d/firefly.conf so that it runs under the new server

    3 Mal editiert, zuletzt von mjnaylor8 () aus folgendem Grund: Added add_header Strict-Transport-Security "max-age=15768000;includeSubDomains"; to nextcloud configuration. Needed as new add-header see . https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/ Added add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" always; to the Wordpress config so images are correctly displayed in the frames.

Jetzt mitmachen!

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