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 (
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.

heyyo's picture

Drupal7 doesn't generate Image style when filename contains "&" => error 404

I'm using NGINX Perusio configuration. It works great.
I just have an issue with some images with the character "&" inside filename.
Drupal returns an error 404 when browsing image styles version of those images.

When accessing the image directly without image styles it's working as expected.

I thought using LUA NGINX module will resolve my issue, but it doesn't seem the case.

set_by_lua $escaped_uri 'return ngx.escape_uri(ngx.var.uri)';
location / {
location ~ ^/sites/.*/files/styles/ {
try_files $escaped_uri @drupal;

Read more
Sakura777's picture

D8 +nginx Error installing anything

A fresh install of drupal 8, if i try to install any theme i get this error:

An error has occurred.
Please continue to the error page

An AJAX HTTP error occurred.
HTTP Result Code: 403
Debugging information follows.
Path: /core/authorize.php/core/authorize.php?batch=1&id=6&op=do_nojs&op=do
StatusText: Forbidden
403 Forbidden
403 Forbidden

I tried to install themes in drupal 7 and it works fine with nginx
I'm using the recomended nginx setup form the nginx website.

I check the previus threads without any luck.

Read more
spacereactor's picture

How to use private file system that work with image styles for drupal 7 and 8

Spend few days trying to solve this and there is how i get it to work for drupal 7 & 8. If you have better solution for private file system that work with image styles please add in.

I using the standard drupal conf from

Private file system path = sites/default/files/private
if you use other path change according for your setting at location ~ ^/sites/.*/files/private/styles/


Read more
renukakulkarni's picture

D8 + Nginx - On clicking of 'Save' button from main menu scrren, all menu items get disabled.

On clicking of 'Save' button from main menu scrren, all menu items get disabled.
The only way menu can be enabled is by editing menu item and then mark it as enabled.

If I click on enabled box for any of the menu item and click 'Save', it does show message - "Menu Secondary Menu has been updated" but all menu links under that menu gets disabled.
This problem is only on nginx sever. On apache server and acquia cloud, there is no any such kind of issue.

My Environment Details:

Server - nginx version: nginx/1.8.0
PHP version : PHP 5.6.14
OS - FreeBSD

Read more
odili's picture

Drupal 8 update.php/selection - Access Denied

I wanted to update d8 from 8.0.1 to 8.0.2, but i couldn't run the update.php due to the error "Access Denied". Am logged in as user1 which should have all required privileges.Following the drupal 8 update guide I deleted core and vendor folders with all the files in the drupal root from the the 8.0.1 install, and replaced the same files and folders from the newly downloaded 8.0.2 version.

What could be the solution to this problem?

My Environment:
OSX El Captain, nginx 1.8 using the latest config from, PHP 7.0.2

Read more
rkudyba's picture

Drupal 7 login does not work on NGINX after enabling SSL with Letsencrypt, Resource temporarily unavailable

We are on Digital Ocean, nginx/1.4.6 (Ubuntu), and I followed the Letsencrypt tutorial and the SSL cert verifies as valid. However the Drupal login to access the admin no longer activates and the page just reloads to itself. I enabled debug for the NGINX logs and below are the results. It ends with:
*recv() not ready (11: Resource temporarily unavailable). *

Read more
Anonymous's picture

D8 + split-nginx frontend + backend-proxy config loses D8 theming; otherwise functions OK

I run nginx 1.9.9 + php7 + php-fpm

With a single, standlone nginx config, I installed Drupal 8.0.1. Everything works & displays correctly.

Next, I need to split the nginx config into front-/back-ends.

I created two configs for the front- & back-ends.

In the split-config, Drupal functions correctly, but displays no themeing; just 'generic'.

css links in ViewSource are accessible.

I suspect I've missed something in header-passing between the front & back.

Here are the current configs I'm working with,


server {

Read more
olomouc's picture

mixture of drupal and non-drupal sites with Perusio config

I have a couple of no drupal sites i need to put on a server containing mostly drupal sites one of which should be served with index.html. If I browse to index.html then the site is fine but I cant get the root url to show index.html.

If I put this as a nested location in drupal.conf then it works but it then breaks all the drupal sites. I can't put it in the site config because it compains of duplicate location directives.

location / {
try_files $uri /index.html;

Read more
Nikhil Mohan's picture

Drupal path problem with nginx/1.9.5

I am trying to install drupal on nginx 1.9.5
here is my default.conf

When i set up my css/js paths are missing see att.

its like

@import url("");
@import url("");
@import url("");
@import url("");
@import url("");

Read more
hkvega01's picture

Nginx as frontend of apache images style not generate when clean-url is on

i'm trying to make a nginx as a proxy of apache, when the clean-url is on, i upload a image to a field, the thumbnails is not generated. I had read all of the thread around the google and tried every solutions but not work, here is my nginx vhost file

server {

 listen 80;
 access_log /var/log/virtualmin/example.com_nginx_access_log;
 error_log  /var/log/virtualmin/example.com_nginx_error_log;

 location / {

    index index.php;
    include /etc/nginx/proxy.conf;
Read more
olomouc's picture

Image styles when imported from apache not creating

I have a bunch of image files that have come from an apache staging server which have been converted, e.g a space has been converted to %20, so the imported images are my%20image.jpg. These are not viewable and the subsequent image styles are not being created. If I upload images with spaces directly on to nginx then no problem. I am using Perusio's config which seems to be setup to resolve escape characters, however it doesnt like files with % signs in them. Any ideas how to resolve this?

Read more
luxpir's picture

Simple SPDY config not working

I've posted this issue in the queue at the Perusio config page on github, but wondered if anyone else has an idea in more general terms of how to get an up to date system to do an NPN handshake?

Github issue

  • Ubuntu 12.04 LTS
  • Nginx 1.7.12 (upgraded today from Ubuntu mainline/dev PPA)
  • OpenSSL 1.0.1 (build from 19/03/15 - upgraded today)
Read more
olomouc's picture

Issue with Image styles where spaces in image title

I have noticed that images with spaces - rewritten as %2520 - are not being saved to the image style folder. If I resave the image with a sensible title then the image gets saved in the image style folder. I am using Perusio's config. Does anyone know how I could fix this in drupal.conf (with a rewrite?)?

Read more
haunted's picture

Tutorial to tune php-fpm

Hello people, i run my drupal 7 site on a VPS with 1GB of ram with a LAMP stack. I would like to switch to nginx and php-fpm because people keep saying that php-fpm saves a lot of memory compared to apache mod_php.

Unfortunately, the last time I tried, i did not have much success. I had the cpu overloaded, or soimetimes "page not found" for some pages pages, or max-children limit reached in logs.

Read more
olomouc's picture

Is this an nginx issue with node add form?

I am not sure this is a great way to do this but I have been trying to get a node/add/form available to anonymous users. Whichever content type I set permissions for anonymous to add content I get access denied (403). I thought this might be something in Perusio's config that disallows this - ddos reasons - but if I select 'Bypass content access control' for anonymous as a test then I can see the node/add/form as anonymous user. Do you think this could be an nginx issue that 'Bypass content access control' is able to override?

Read more
olomouc's picture

Stuck with Perusio config

I have installed nginx and php5-fpm and using perusio's D7, tcp configs but the best I can get is the default index.html page in /usr/share/nginx/html. Even with the 000-default virtual host disabled i still get that html page. If I comment out example to the best of my understanding i get a loopback issue. So i disable 'return' line and then I get back to index.html.

I would be very grateful for some pointers. Here is my virtual hosts file. Ive got dns pointing to nginx.*

server {
listen 80; # IPv4
server_name nginx.*;

Read more
heyyo's picture

Symlink in document root produces error 404

Before starting, i should say I don't have this issue with Apache, only with Nginx. I'm using perusio config for Drupal 7.

I'm using the module subfolders domains ( to create domains as subfolders(uri) of my main domain.
PS: This module is using the module Domain Access

This module creates symbolic links in drupal document root for each subfolder.

Example: in my Drupal document root I have several symlinks:

france -> /var/www/drupal
uk -> /var/www/drupal

Read more
Kristina Katalinic's picture

prevent search engines from indexing CDN Subdomains

Hi all,
I am new to nginx so hopefully someone here can help me.
Since my site will have a lot of images submitted by registered users I use CDN module to serve static files from Cloudfront and that is working well.
But there is one serious caveat: my site can be accessed from CDN subdomains thus creating a duplicate content issue which is a serious problem for SEO.
I've searched high and wide before posting here but with no success.
Is there a way to prevent search engines from indexing my CDN subdomains?
My CDN setup looks like this:
http://js.mysiteurl|.js .otf .ttf .woff .eot

Read more
spessex's picture

Solution for x 2 SSL's sitting on same architecture?


I was hoping someone might be able to help with an issue that I have.

Basically I want two different SSL's (as they belong to two different and independent companies) to sit on my AWS architecture but my architect is trying to tell me this is not possible, which I personally can't quite believe.

The current system has been working perfectly for around 6 months using the x 1 SSL cert, but now I want to use a 2nd SSL cert this is where the problem has raised its head.

Read more
Subscribe with RSS Syndicate content


Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: