Apache2 to Nginx, rewriting rules

Discussion in 'Server Operation' started by sumfvm, Apr 26, 2018.

  1. sumfvm

    sumfvm Member

    I host a little ISPConfig server (about 60 websites) and I'm migrating from an old server (Debian 6.0, Apache 2, PHP 5.7, etc.) to a new one with the .ovf provide (Debian 9.0, Nginx, PHP 7.0, etc., this one : https://www.howtoforge.com/tutorial/perfect-server-debian-9-nginx-bind-dovecot-ispconfig-3.1/) and I meet a problem: Some of my clients have some Apache2 rewriting rules who don't work anymore (notice I only migrate some websites, not all), so how big hosting companies handle the migration of thousands clients from Apache2 to Nginx?
    As I understand, I have to "translate" all the rewriting rules of my clients for an usage on Nginx, so it is not possible for them to be dependant to me, so, what is the solution? Is it possible to setup a server with both Nginx and Apache2, in order to be able to choose which one fit to the needs?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Nginx is normally provided by managed hosters only due to the problems with nginx rules or for end users when they have a vserver or root server so they can manage the rules themselves (if they can, but most end users can't do that anyway). On managed hostings, the server provider takes care about the rules. This also implies that normally one would not try to do a transition from Apache to nginx if it's not a managed hosting. Offering nginx hosting to new clients is a bit different, in such a case you as a provider would provide ready-made rule sets for different cms systems (see function System > Directive snippets) so that the end user can select a snippet matching his CMS (e.g. wordpress, joola, magento and so on).

    To sum it up, nginx is a very nice and fast web server, but it will never become the 'standard' web server for everyone due to the limitations in letting end users provide rules for it (no .htaccess like mechanism and the problem that existing rules in a vhost cannot be overridden by later rules that set the same location, ispconfig has developed mechanisms to overcome the location limitation with our own merge and delete syntax though). To provide nginx hosting to your users, you should either offer managed hosting support incl. the support to write and setup rules for your customers or you should consider to limit nginx hosting to certain cms systems that you provide ready-made rule sets for as Directive snippets or you should provider whole server / vservers to your customers so that they have to figure the config out themselves.

    That's just an opinion from my personal experience with supporting hosting providers and their setups. Maybe some others might chime in and post their experience and opinions on that.
    concept21 and sumfvm like this.
  3. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    you can not migrate anything without manual interaction from apache to nginx. but you can create snippets / website-directives for each cms and assign the correct setup to each domain.
    personally, i would not migrate 60 websites in on run from apache to nginx. it makes more sence, to migrate all sites with one cms and continue with the next cms.
    concept21 and sumfvm like this.
  4. sumfvm

    sumfvm Member

    Thank you Till for your perfect answer!
    Thank you florian030 for this information, it makes sense :)

Share This Page