<p>There is no "this over that" for Craft specifically. Your own statement "it depends" plays a big role. I would read this pretty extensive post on DigitalOcean "Apache vs Nginx: Practical Considerations" as a good start on what software to use.</p>

<p><a href="https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-considerations">https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-considerations</a></p>

<p>For me personally this has always been the key difference in choosing between the two:</p>

<blockquote>
  <p><em>In terms of real world use-cases, one of the most common comparisons between Apache and Nginx is the way in which each server handles requests for static and dynamic content.</em></p>
</blockquote>

<p>Usually you don't need all the extra features Apache comes bundled with. You have your Craft website, that's it. Nginx (for me) has all the functions it requires and can handle a lot of requests on lower hardware. For me personally that's key.</p>

CC BY-SA 3.0
2015-06-09T08:13:56.997Z
Thanks.  Basically, I have a site with a lot of articles with some images and a number of embedded videos from Vimeo.  It sounds like nginx should be fine based on what you said.
Moshe
CC BY-SA 3.0
2015-06-09T06:45:31.310Z
2015-06-09T06:45:31.310Z
naboovalley
<p>Putting aside Craft for a moment, it's not just Craft, you'll usually end up throwing more things on a web server as time goes by. If those scripts/apps are expecting an .htaccess file and you're using nginx, you have to do some extra work to get those rewrite rules or additional pieces of magic working. </p>

<p>As someone who cut his teeth on Apache, I've swung both ways to being an Apache fanboy to being indifferent about it. It's the status quo and it'll really handle anything you throw at it but nginx is really the better web server these days.  It has a more saner, albeit longer learning curve when it comes to configuration, but once you get it, it's hard to look at Apache's jumble of XML.</p>

<p>It does a lot of stuff really really well, including caching and serving static files extremely quickly. And it's also the little things. You can also log different aspects much easier; Apache logs by vhost, but nginx allows you to log requests based on location or not log them at all. (For example: there's not really a great way to not log things like favicons or static files in Apache; in nginx it's just a simple <code>location /favicon.ico { access_log off }</code> block. It also has throttling and other resource management features built in to help keep the bots and script kiddies from eating up your resources. nginx caching can help prevent knocking out your server if it becomes DOSed since it's serving up a static files (instead of tearing into php).</p>

<p>For what it's worth, on a low traffic server, you probably won't see much difference. For Apache, I use mpm_worker combined with php fpm and that seems to be working out pretty well. I'm actually in the process of putting up a new server and that one will be nginx but right now Apache is working great too.  Apache prefork's mpm tends to eat memory if you're not careful so avoid that mpm if you can, especially if you're on a VPS, because every resource it serves will have php loaded up already.</p>

CC BY-SA 3.0
2015-06-10T19:18:30.597Z
2015-06-10T19:37:23.947Z
2015-06-10T19:37:23.947Z
RitterKnight
<p>Any recommendations as to whether it is better to use Apache or Nginx for a Craft website?</p>

<p>If the answer is "it depends", could you please delineate some of the advantages and disadvantages of each option?</p>

<install><nginx><apache>
Apache or Nginx for a Craft site
# Apache or Nginx for a Craft site

(Asked by: username_0 on 2015-06-09)

Any recommendations as to whether it is better to use Apache or Nginx for a Craft website?

If the answer is "it depends", could you please delineate some of the advantages and disadvantages of each option?

**Tags:** install, nginx, apache

---

## 2 answers

### Answer by username_1 on 2015-06-09. Score: 6

There is no "this over that" for Craft specifically. Your own statement "it depends" plays a big role. I would read this pretty extensive post on DigitalOcean "Apache vs Nginx: Practical Considerations" as a good start on what software to use.

<https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-considerations>

For me personally this has always been the key difference in choosing between the two:

> *In terms of real world use-cases, one of the most common comparisons between Apache and Nginx is the way in which each server handles requests for static and dynamic content.*

Usually you don't need all the extra features Apache comes bundled with. You have your Craft website, that's it. Nginx (for me) has all the functions it requires and can handle a lot of requests on lower hardware. For me personally that's key.

> **Comments:**
> **username_0**: Thanks.  Basically, I have a site with a lot of articles with some images and a number of embedded videos from Vimeo.  It sounds like nginx should be fine based on what you said.  

---

### Answer by username_2 on 2015-06-10. Score: 6

Putting aside Craft for a moment, it's not just Craft, you'll usually end up throwing more things on a web server as time goes by. If those scripts/apps are expecting an .htaccess file and you're using nginx, you have to do some extra work to get those rewrite rules or additional pieces of magic working.

As someone who cut his teeth on Apache, I've swung both ways to being an Apache fanboy to being indifferent about it. It's the status quo and it'll really handle anything you throw at it but nginx is really the better web server these days. It has a more saner, albeit longer learning curve when it comes to configuration, but once you get it, it's hard to look at Apache's jumble of XML.

It does a lot of stuff really really well, including caching and serving static files extremely quickly. And it's also the little things. You can also log different aspects much easier; Apache logs by vhost, but nginx allows you to log requests based on location or not log them at all. (For example: there's not really a great way to not log things like favicons or static files in Apache; in nginx it's just a simple `location /favicon.ico { access_log off }` block. It also has throttling and other resource management features built in to help keep the bots and script kiddies from eating up your resources. nginx caching can help prevent knocking out your server if it becomes DOSed since it's serving up a static files (instead of tearing into php).

For what it's worth, on a low traffic server, you probably won't see much difference. For Apache, I use mpm\_worker combined with php fpm and that seems to be working out pretty well. I'm actually in the process of putting up a new server and that one will be nginx but right now Apache is working great too. Apache prefork's mpm tends to eat memory if you're not careful so avoid that mpm if you can, especially if you're on a VPS, because every resource it serves will have php loaded up already.


---

