Move from apache2 to nginx inplace

Discussion in 'Server Operation' started by muekno, Jan 17, 2026.

Tags:
  1. muekno

    muekno Active Member HowtoForge Supporter

    I hope I am in the right forum. I have a hosted (under PROXMOX) Debian 12 VM ISPConfig managed server with 500GB, half of it free.
    beside mail for some users with POP and IMAP and Roundcube acccess it routes mail for some domains to other nail servers.
    then there are some smaler websites and a NEXTCLOUD instance under apache2. Debian 12 and ISPconfig are on lattestes patch level.

    I think about migrate from apache to nginx, Is there a secure way to do that and how?

    Thanks for any help or hint

    Kind Regards
    Rainer
     
  2. remkoh

    remkoh Well-Known Member HowtoForge Supporter

    If websites have no directives and .htaccess files it should be fairly straigh forward.

    Apache directives are completely different than their nginx counterpart.
    If any of the websites have directives you should translate them prior to migrating.

    Also Nginx cannot handle .htaccess files!
    Here too if any of the websites have .htaccess files you should translate them into directives or some other alternative prior to migrating.

    When you've finished your preparations you can uninstall Apache2 and install Nginx.
    Afterwards run "ispconfig_update.sh --force" so ispconfig knows your new webserver is Nginx and resync all your websites under System >> Resync and restore directives if any.

    Before you start anything make sure you have a backup you can fallback to if anything goes wrong!!
     
  3. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

  4. muekno

    muekno Active Member HowtoForge Supporter

    Thank you for all the answers. What I am looking for is some step by step tutorial.
    remko says "Apache directives are completely different than their nginx counterpart.
    If any of the websites have directives you should translate them prior to migrating."

    Where can I find some mire specific information?

    Kind Regards
    Rainer
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Why do you want to switch from Apache to Nginx? Such a step is only a good idea if you know Nginx well. If not, better stay with Apache. There is no huge difference in speed anymore as of today, and Nginx is way more complicated to use for the average user, as it does not read .htaccess files, so you must convert any .htaccess file to Nginx config syntax before websites that rely on .htaccess work.
     
    muekno likes this.
  6. muekno

    muekno Active Member HowtoForge Supporter

    I have a hostet server running a Nextcloud instance, thought NGINX gives me a bit more performance.
     
    /dev/null/ likes this.
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    I do not think you will get a noticeable difference or improvement. If Nextcloud is too slow, I guess checking if there are any optimizations or caches possible in NextCloud or using a larger VM with more cores or RAM will be more beneficial than trying to switch to Nginx. Here a short research on recent benchmark data:

     
    muekno likes this.
  8. till

    till Super Moderator Staff Member ISPConfig Developer

     
    muekno likes this.
  9. remkoh

    remkoh Well-Known Member HowtoForge Supporter

    I'm with @till on this one.
    If you're not familiar with Nginx don't even try to migrate and first learn the differences, advantages and disadvantages compared to Apache.
     
    muekno likes this.
  10. muekno

    muekno Active Member HowtoForge Supporter

    Thanks to Till and remkoh for all this information. I have less than 10 useres, so if I understand you right, no need to migrate.
     
  11. /dev/null/

    /dev/null/ New Member

    Only advantage right now that could impact nextcloud would be HTTP/3, and better reverse-proxy solution that you would have to do by hand.
    As Till said, you would only benefit if you are advanced user and/or expert in nginx
    and for nextcloud instance disk speed will be the bigger bottleneck thank apache2.
     
    muekno likes this.

Share This Page