Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

WordPress is quite a memory hog, and I've been thinking of using nginx rather than apache.

The one major consideration before doing that is if there are any plugins which will stop working. I have tested a few and they seem to work, but I need to find out if there are any which might break.

share|improve this question
2  
"...nginx rather than wordpress." Perhaps you mean "nginx rather than Apache"? –  Grant Palin Aug 13 '10 at 17:26
    
Thanks Grant. Edited. –  Sudhanshu Raheja Aug 13 '10 at 23:26
add comment

6 Answers

up vote 3 down vote accepted

I unfortnately have no experience with this but evidently it can be done as these articles and plugins address some of the issues:

Also are you familiar with WP Engine WordPress hosting? They are evidently using it in a hybrid form with Apache, probably as a front-end proxy.

Hope these help.

share|improve this answer
    
Thanks for the links Mike. I've tried a number of plugins with it and it seems to work great! –  Sudhanshu Raheja Aug 16 '10 at 12:38
add comment

Small world :). You won't see a lot of issues with Nginx and Apache + Wordpress. We use it for our company as well, and we have no problem getting one server to serve 200k uniques/month and over a million pageviews/month for one site. Nginx + W3 Total Cache, you get some very remarkable numbers.

share|improve this answer
    
Yeah :) Thanks for the update. I've been trying it out myself and looks quite solid! –  Sudhanshu Raheja Aug 16 '10 at 12:41
add comment

The biggest difference is rewrite rules, but there are plenty of guides out there (such as the ones Mike linked) that provide you with equivalent rewrite rules.

From a plugin perspective, unless the plugin is doing something really crazy, then it shouldn't know the difference. All internal rewrite rules and that sorta stuff is handled at the WordPress level, independently of your HTTPD.

In short, go for it.

share|improve this answer
    
Thanks Viper. I got a lot of samples of nginx rules to replace the ones for apache. Besides, have been trying writing Nginx's rules myself, and it seems pretty straight forward. So this shouldn't be an issue anymore. –  Sudhanshu Raheja Aug 16 '10 at 12:39
add comment

Using Nginx will not make Wordpress use less memory. If you're concerned about memory, you can save some server-wise by optimizing your Apache configuration to only load the modules you need and do other configuration that will reduce the memory apache needs.

Next to that, Apache has caching modules as well worth to consider, so to save all memory WordPress would have used when invoked. Since WordPress output get's cached, Wordpress does not need to run any longer and you save the memory.

share|improve this answer
    
@Krzysiek Dróżdż: You added typos, but you didn't fix them. Names in English have uppercase only on the first letter. Everything else is doing vendor marketing which is not professional in technical writing. –  hakre Dec 16 '13 at 10:30
    
There is no such thing as "Wordpress". The software we are talking about is called "WordPress" - this is trademark and it's the only proper way to spell it. (If you have some other idea, just take a look at how this site is called ;) ). –  Krzysiek Dróżdż Dec 16 '13 at 10:41
    
See, this is the difference between using a noun or repeating the marketing of some vendor. And for the proper way to spell it, ask your English teacher/tutor first probably if you're looking for a second opinion. And about the trademark, I suggest you take a look into the trademark database first, which marks have been registered exactly... . –  hakre Dec 16 '13 at 10:46
    
If you use WordPress, you should spell it correctly - and the proper way is WordPress (that's how this software is called). Take a look at the title of this site - is it "Wordpress Answers" or "WordPress Answers"? Also take a look at this poll (wptavern.com/do-you-mistrust-a-company-that-misspells-wordpress). –  Krzysiek Dróżdż Dec 16 '13 at 10:54
    
Well, I don't know you, but generally I would say it's not wrong to use English language properly. That's nothing wrong. Everything else might be wanted by Mark Mullenweg (as of he dreams of and that's fine), however I'm not under dictate by him telling me what is wrong or right. So thanks, I'm okay with using my brain myself, you don't need to invest more time to "correct" things here. –  hakre Dec 16 '13 at 11:06
show 4 more comments

When WordPress detects that mod_rewrite is not loaded it falls back to pathinfo ie:(/index.php/%postname%/) permalinks in Permalink Settings page. You can use the nginx Compatibilityplugin to force WordPress to use pretty permalinks then add rewrite rules to your nginx server file:

server { server_name mysite.com;

root /path/to/blog;

index index.php;

location / {
    try_files $uri $uri/ @wordpress;
}

location @wordpress {
    fastcgi_pass ...;
    fastcgi_param SCRIPT_FILENAME $document_root/index.php;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_NAME /index.php;
}

location ~ \.php$ {
    try_files $uri @wordpress;
    fastcgi_index index.php;
    fastcgi_pass ...;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
}

}
share|improve this answer
add comment

The docs are written in Russian and somewhat vague. Sometimes you're wondering if the translation is bad or if the docs are just not very explicit in the first place. So finding answers is sometimes time-consuming and/or requires trial-and-error testing.

However, the author seems very engaged with the community, explaining configuration options. And NginX itself gives you some feedback, such as "you can't use this option here."

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.