This group is dedicated to share experiences on using Nginx as a webserver for Drupal sites. The goal is to provide community powered support for anyone looking for Nginx related advice, configuration examples and tuning. This group was born from a long thread about Nginx and Boost integration.
Nginx for Drupal configuration projects/examples:
Barracuda Aegir by omega8cc (Drupal.org)
Boost compatible by yhager (GitHub)
Idiosyncratic bleeding edge config by perusio (GitHub)
Please file issues, post patches and improvements for projects hosted on GitHub on the GitHub issue tracker.
RSS Feed not working Drupal + Nginx + Boost Configuration
Hi,
I have been trying to figure this out but unable to fix this issue. I have setup and enabled Boost on Nginx and it works fine now but I cannot access my rss.xml file. It throws Nginx 404 Page not found error
Here is my Nginx Configuration file
server {
listen 80;
server_name www.pakreviews.com;
rewrite ^(.*) http://pakreviews.com$1 permanent;
}
server {
server_name www.pakreviews.com;
access_log /www/projects/pakreviews/logs/access.log;
error_log /www/projects/pakreviews/logs/error.log;
root /www/projects/pakreviews;
charset utf-8;
Read moreNginx Wiki - Drupal
I took the time to write up a best practices wiki page on the Nginx wiki for Drupal. Your configurations may or may not be similar and may or may not add extras. The setup in the Nginx wiki will not cover things like using Boost or Varnish.
The configuration in the wiki will provide an excellent base for anything you want to do with Drupal (and Pressflow). It takes a lot of beginner mistakes and explains why they are the wrong way. There are a massive number of beginner mistakes that I've seen around drupal.org and the rest of the Internet. I hope that linking to this page will help.
Read morenginx redirects to install.php
Hi,
I hope this is the right place to ask this question. I have switched from apache to nginx by using the config files from yhager on http://github.com/yhager/nginx_drupal. When accessing the site, I am redirected to install.php. How can I enable logging in order to track down the problem? Any help is appreciated.
Regards
Stéphane
Read moreCurrent status and stability of nginx with Drupal
Hi,
Forgive the newbie question but I hope this will be of use to others and help people decide whether nginx is for them.
I'm currently planning a new server and am considering using nginx in place of apache. I've been reading through several posts in this group and found some interesting discussion. What would be really useful though is to get a sense of the current status of support for nginx in Drupal, so that those in my position can make an informed decision about whether Drupal + nginx is currently solid, stable and well supported or experimental, bleeding-edge and only for the intrepid.
The impression I've got so far:
Read moreClickjacking protection through X-Frame-Options and STS
Hello everyone,
I've used extensively the configurations available at github by omega8cc and yhager. I've added a few things myself and I will share it on github soon.
One of the things I added is clickjacking protection through the X-Frame-Options header. This is supported in modern browsers and also on IE8. Mozilla Dev Center explanation of this header.
The best thing is to add in your server context:
add_header X-Frame-Options sameorigin;Nginx configuration with Boost Help
Hi, I am running my website Pakreviews.com on Nginx with Boost enabled but I am not seeing any performance difference by Enabling or Disabling boost at all. Here is my nginx configuration file, Please help me out figuring what might be the issue
server {
listen 80;
server_name pakreviews.com;
rewrite ^(.*) http://www.pakreviews.com$1 permanent;
}
server {
listen 80;
server_name www.pakreviews.com;
access_log /www/projects/pakreviews/logs/access.log;
error_log /www/projects/pakreviews/logs/error.log;
location = / {
root /www/projects/pakreviews;
Nginx + gzip + Boost
I have read about configuring nginx + boost for drupal.
I decided to install boost for my site.
Now I have nginx + php-fpm + APC + drupal.
On Drupal installed Cache Router with all cache in APC.
APC = 256Mb.
Could you help me to configure nginx + boost for best performance?
- Content is dynamic - news site, will boost correctly clear cache after news added, so changed block of views in all pages?
Is it worth to cache for 5-10-15 minutes? Or configure boost to cache only "complicated" pages, like main page with many blocks?
Barracuda Aegir with Nginx Edition 0.4-HEAD-A12.D (Lucid, Karmic and Lenny compatible)
UPDATE: Barracuda and Octopus new home is on d.o, plus there is BOA group:
http://drupal.org/project/barracuda
http://drupal.org/project/octopus
http://groups.drupal.org/boa
UPDATE: After introducing dual-core Barracuda/Octopus Aegir Installer, this thread is continued also here: http://groups.drupal.org/node/89594.
Read morePHP profiling with XHprof
If you're looking to track down the module which is killing your page load times, you may need profiling. Most people have used xdebug for this in the past with something like webgrind to display the information. Things have gotten easier.
Facebook has developed a PHP extension called XHprof and released it under the Apache license. It comes with a nice sample web interface.
Read moreHow do you use Nginx?
Nginx now properly supported in Aegir
It finally works as expected (well, almost - it's still alpha! :). You can try Provision available on GitHub: http://github.com/omega8cc/provision. It includes modified install script and hostmaster makefile to make your life easier.
[UPDATE: now it supports also SSL integration and apt-get Nginx versions, with Boost compatibility, but it should be at least nginx-0.6.36, so with Debian you need backports, and with Ubuntu you need at least Karmic or newer.]
Read moreHow to use nginx proxy_cache to cache all matched uri ?
I have several drupal sites that rarely change. I want nginx to cache all uri in proxy_cache for x days, except
location ^ admin/*
For example, a user requests /node/3, nginx looks for the uri in proxy cache. If it finds it, then serves it directly. If it can't find it, proxy the request to backend (apache+php in my case). When apache returns the content, nginx puts it in proxy cache and send it to the user.
My current conf works (I don't use imagecache) but doesn't achieve my goal. Here is my configuration file in whole.
server {
listen 80;
server_name example.org;
root /var/www/pf;
index index.html index.php;
####### PART 1 ######
location ~* .+\.(ico|jpg|gif|jpeg|css|js|flv|png|swf)$ {
expires max;
proxy_cache cache;
proxy_cache_key $host$uri#is_args$args;
proxy_cache_valid 200 304 12h;
proxy_cache_valid 302 301 12h;
proxy_cache_valid any 1m;
}
############ PART 2 ################
# we need this 'location / ' since all drupal requests are handled by index.php
# and since by simply use location ~* .php$ won't work??!!
location / {
proxy_pass http://apache;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}
I think in PART 1, I put static files in proxy cache. Static file served by nginx but I can't verify whether they come from the proxy cache.
Is there a way to injecting a special header value before putting a file into the cache? So i can tell if a file is coming from the cache simply by looking at the headers.
PART 2 seems to me to make ALL requests go to apache. But I want nginx to try proxy cache first.
How do I do that? Thanks in advance!
Read moreNew module - FileField upload progress in Nginx
After some discussion on the filefield issue queue, today I released a module that adds the much needed upload progress functionality to sites running on nginx servers. Brian suggested I also post here as it may be useful to others not following that issue.
Read morenginx + postfix
Hi all,
I just created a drupal setup with postfix.
When i try to create user, i expect email will be send out to user to notify them.
But what i get is 'Unable to send e-mail. Please contact the site administrator if the problem persists.'
i installed postfix as some suggest, but not problem persist.
anyone can kindly advise how to do it?
i thinking of receive email using google apps (on thunderbird) and send email using my own smtp (to avoid sendmail limit)
Nginx+Pressflow Config
I'm using this for configuration of Nginx and Pressflow. I was wondering if anyone sees any obvious issues in it. If not, then I'm happy to share something that many others can use.
michael@insto:/etc/nginx$ cat conf.d/profarius.com.conf
server {
server_name profarius.com;
include templates/pressflow;
}
michael@insto:/etc/nginx$ cat templates/pressflow
<
pre>
root /home/$server_name/pressflow;
location / {
try_files $uri $uri/ @pressflow;
}
location ~ .php$ {
include fastcgi_params;
php5-fpm and fcgiwrap ubuntu packages
I've been using the dotdeb.org pacakges for my ubuntu 9.10 servers and they've been running well, except for some necessary patches to contrib modules for php 5.3.
Now ubuntu 10.04 lucid is out and has php 5.3.2 in it. While php5-fpm won't be included in an official release until at least 5.4, it has become a part of official php development and is contained in the php version control.
Read moreNginx Boost rules for subdirectory?
Hello,
I mean subdirectory is:
http://www.domain.tld/ is one Drupal installation, and http://www.domain.tld/app1/ is another Drupal installation.
I use this rules, and still not works:
server {
listen 80;
server_name domain.tld;
location / {
root /var/www;
index index.php;
set $boost "";
set $boost_query "_";
if ( $request_method = GET ) {
set $boost G;
}
if ($http_cookie !~ "DRUPAL_UID") {
set $boost "${boost}D";
}
if ($query_string = "") {
set $boost "${boost}Q";
}
Heads up with Drupal 7 tests
A heads-up to my fellow developers. I ran into this problem on Lighty, but it probably is going to occur on all non-Apache server daemons, so I'm cross-posting this to the Nginx and IIS groups too.
Read morePHP 5.3.2 with php-fpm
php-fpm, the improved process manager for php-cgi, is now included in [an experimental branch of] the PHP 5.3.2 distribution. There are some deb packages out there and it has become very easy to install. No compiling necessary. I recently installed it on my home dev server to test it out and it worked without too much trouble. My home server is running ubuntu 9.10, the karmic release.
Read moreTutorial for using Nginx in front of Apache and mod_php, to serve static files?
Hello all! I've been looking through this group's discussions, and am very thankful for all the help and advice. Here's my situation: I recently moved from shared hosting to a VPS (Linode.com). I'm a relatively competent with html/css/php, etc., but am fairly noobish when it comes to the whole server side of things. I can find information, and follow and adapt tutorials, but have a hard time knowing how to hack things out from scratch.
So I've set up my VPS running Ubuntu 9.10 (Karmic) with Apache2, mysql, and php, and have my vhosts up and running with drupal. What I want to do now is set Nginx up as a static file server, leaving dynamic content to Apache and mod_php. I just haven't been able to find a comprehensive tutorial for how to do that, taking drupal into account (specifially, image_cache and boost). Basically what I'm looking for is this:
http://www.lullabot.com/articles/using-lighttpd-static-file-server
But geared towards Nginx instead of Lighttpd (because of the memory leak issues I've read about). Can anyone point me towards some good resources to help me get this set up?
Thanks a ton!
Read more



