Why are people recommending NGINX over Apache?

I have noticed some people recommending NGINx over Apache for NextCloud. I understand that using either is choice made under given circumstances. But I am interested to know what those would be based on your experiences.

Why would NGINX be a more suited candidate for Nextcloud if at all?

I am by no means a day time server admin. So, obviously I feel its not wise to spend time learning NGINX when I could better spend my fun-time learning some other UNIX program. After all going deep into NGINX as well as APACHE is redundant knowledge for a hobbyist. This is my view based on my circumstances.

I am more familiar with nginx then apache. And I know what nginx can handle.

And the ability to use the built in cache functionality and reverse proxy is nice.

That is all.

1 Like

I think most people use what they know best. I had some experience with Apache already, so that’s what I went with.

Nginx recently had a major security vulnerability with Nextcloud. Nextcloud’s documentation also indicates it isn’t safe to install Nextcloud in the web root of a nginx server. Would that have made me switch if I were a nginx user? Probably not, I would just patch the vulnerability and not install at the web root.

People have a lot of opinions about whether one or the other is more suited to a particular facet of Nextcloud’s operation. At the end of the day, they both do the job when configured appropriately, so use whichever you want.

1 Like

Notice that if you use Apache, dont use .htaccess as much as possible :
https://httpd.apache.org/docs/2.4/en/howto/htaccess.html

1 Like

I’m with you. I don’t use either. For my needs, Caddy with automatic HTTPS fits the bill.

1 Like

I wish I knew how to use Cadddy – its just most of the documentation either references apache or nginx. It makes it hard to switch.

It’s surprisingly easy to transition and dead easy for a noob like me to use. For instance, this is my Caddyfile block to support Nextcloud:

cloud.mydomain.com {
  tls {
    dns cloudflare
  }
  gzip
  proxy / http://10.1.1.29 {
    transparent
  }
}

That’s literally all there is to it. That’s using Caddy v1. Caddy v2 is about to be released and I believe the Caddyfile block will distill down even further, possibly to a single line that looks something like this:

caddy reverse-proxy --from cloud.mydomain.com --to http://10.1.1.29

Hi,
When I had my first contact with web servers I was choosing nginx because I read that it is faster. Later I sticked with nginx just because I found the configuration much easier and more intuitive.
Then I read the following text and now I tend more towards apache:
https://ownyourbits.com/2017/06/12/why-nextcloudpi-uses-apache-and-not-nginx/

2 Likes

Nginx was faster for static pages, and because it supported php-fpm. With dynamic content such as Nextcloud the difference to Apache isn’t big, if any at all…since most of the work is done in php-fpm.

All reverse proxy stuff was always supported by Apache.

2 Likes

Hey,

I read and its very short… they quote another site in your site :


I find it more fair and complete.

Moreover, the author said that apache is more secure but there is no argument…
The only argument in favor of apache is that you need to compile all if you want to add some modules. But the apt repository include a lot of modules (nginx-extras or nginx-full).

1 Like

Just a comment from a none IT “expert” : I have learnt as much of Apache that was needed to install and run Nextcloud. I haven’t experienced any problems and in line with your comment above, why indeed spend more time learning another server when what we have works. I have considered NGINX but I see nothing that would justify a change.

There is good information from the above answers and also on the web for anyone to make an informed choice if starting from scratch.

1 Like

In regards to nextcloud – it’s actually easy to switch between the two (Apache and nginx). I switched to nginx since in most of my other server applications which required a reverse proxy, I was becoming more familiar with the nginx syntax overtime. I believe in terms of performance there may be some advantages using nginx as a reverse proxy as compared to Apache in terms of number of threads that can be used.

In terms of security – there are always concerns since Nginx was developed inside of Russia, and now the Russian government is suing the nginx corporation due to theft of intellectual property. Whether this ends up harming nginx in any way is unknown but some might use this as a potential concern.

1 Like