Real-Gecko / virtualmin-nginx-fpm

Virtualmin plugin to create Nginx and PHP-FPM powered websites for domains
GNU General Public License v3.0
24 stars 9 forks source link

Customization via Server Templates & Website Options #5

Open sinasalek opened 8 years ago

sinasalek commented 8 years ago

It would have been great if it was possible to customize the configuration template the way virtualmin' apache module allows. This is important because different sites may require special configuration in nginx to work. like for example Drupal or many other CMSs. It's possible to modify the generate configs in /etc/nginx/sites-available but virtualmin overwrites this sort of modification.

Real-Gecko commented 8 years ago

I was thinkin about that, however I did not investigate much what must be done to add new template configurable via Virtualmin. So I left it as it is. As an alternative I can implement templates in nginx-fpm setting. Current config works well with all major CMS'es. Unless you need something special of course :D

sinasalek commented 8 years ago

Are you referring to "Additional Nginx directives for new virtual hosts" in nginx-fpm feature config ? that's actually very useful but it's not possible to to it per domain or template and also not possible to modify the original template, you can only append to it. Here is an example for Drupal, there is also a pager for many other applications as well. As you can see it requires quite lots of custom stuff :) https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/

There is very special option in server templates for plugins, pluing templates Maybe this helps : https://www.virtualmin.com/documentation/developer/plugins look for "Limits and Template Functions"

Real-Gecko commented 8 years ago

Yep, I used this config for some time, but current module config fits Drupal 6 and 7 well - most of sites hosted by my server are Drupal based :D And I saw this manual, functions there do not help to create new template type and use it in your module.

sinasalek commented 8 years ago

:) No it doesn't create new template type, What described in documentation is that it allows for example to expose nginx-fpm module default nginx template to the user so it can be customized per server template. there is another method that parse the outcome template_parse allowing the template to be used for generate the config.

Real-Gecko commented 8 years ago

Anyway it'll require some time to implement. Core Nginx module does not support templates too, otherwise my module wouldn't be needed :D

sinasalek commented 8 years ago

True, core nginx module is actually limited too, it has dozen forks actually :) https://github.com/vixh/nginx-webmin/network

Real-Gecko commented 8 years ago

They all work with fcgid I presume :D

sinasalek commented 8 years ago

Unfortunately yes, only fcgid is supported :(