Nginx

Events happening in the community are now at Drupal community events on www.drupal.org.

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.

Anonymous'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
Anonymous'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.*.org.uk


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

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 (https://www.drupal.org/project/subfolders_domain) 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
index,php
modules
themes
sites...

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?

Hi

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
jason ruyle's picture

Nginx SSL with ajax issue

We have a configuration issue right now and I'm guessing others have experienced it.

We run a site that uses paths like:

/wishlist/ajax/js
/rental/ajax/js

When running on our staging area (on same server) they return the proper results (the ajax update is called and things work correctly).

When we run it on our https version of the site, they return a 404 error.

POST https://oursite.com/wishlist/ajax/js 404 (Not Found)

On the https version of the site, if I change the url to:

/?q=wishlist/ajax/js

Things work correctly again.
What am I missing here?

Read more
superfedya's picture

Perusio D6 config and ngx_cache_purge and CloudFlare question

Hi,

I installed Nginx with ngx_cache_purge module. I want to use it with this module: https://www.drupal.org/project/purge
http://labs.frickle.com/nginx_ngx_cache_purge/

Somebody know where I need put:

proxy_cache_path   /tmp/cache   keys_zone=tmpcache:10m;

location / {
proxy_pass      http://127.0.0.1:8000;
proxy_cache     tmpcache;
  proxy_cache_key     $uri$is_args$args;
proxy_cache_purge   PURGE from 127.0.0.1;
}

I found proxy_cache_path in fastcgi_microcache_zone.conf - /var/cache/nginx/microcache.

And about CloudFlare.

Read more
x.algorithm's picture

Issue with image thumbnails appearing (image styles)

I am unable to get thumbnails and other images that use image styles to work.

http://ursusfightclub.org/people/profile/makoto

'Taking the field in Belmonte' should be the alt tag for the image.

Users are also unable to reset passwords. It returns "You are not authorized to access this page."

I believe they are related to rewrite and nginx

I've checked and utilized https://groups.drupal.org/node/273378
I've attempted to implement Perusio's config http://github.com/perusio/drupal-with-nginx

Read more
johntang's picture

Please help: Nginx config for Drupal + APC + Php + FPM

Hello there,

I use OpenVZ with 4 CPUs and 4GB RAM on Redis 6 (Final). I running Drupal 7 using perusio config and seem the site is load slowly.

My server is using Nginx PHP-FPM, APC, Redis.

These are my config for PHP-FPM:


[www]
listen = /var/run/php-fpm.sock

listen.allowed_clients = 127.0.0.1

user = apache
group = apache

pm = dynamic
pm.max_children = 20
pm.start_servers = 7
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 200

slowlog = /var/log/php-fpm/www-slow.log

php_flag[display_errors] = off

Read more
felixodie's picture

Using Expire on Nginx config making all new images disappear

Hello there,

I've been trying to use browser cache more efficient so I thought using expire in Nginx would be a good idea.

However when I add this code to my Nginx config, all images I've uploaded after the config disappears.

To be more clear;

-Let's say I've uploaded file flower.jpg to my webpage. After upload it looks just fine.
-Then I go to nginx configuration and add following lines to it.
-After that I upload car.jpg file and it's not showing up anywhere. Not in my main page which I use a 100x200px image style, not in node where I use the original image.

Read more
Anonymous's picture

SetEnv how to?

How Do I set Apache's equivalent of SetEnv in Nginx-Drupal.

In the old Apache config, there are some variables defined in the Vhost config eg:

SetEnv db_type mysql
SetEnv db_name mydb
SetEnv db_user root
SetEnv db_pass root
SetEnv db_host localhost
SetEnv db_port 3306

If I go to phpinfo then I can see these variables available in PHP Variables via _SERVER array like _SERVER['db_host'] = localhost and so on.

Now according to surfing the Nginx docs they say to use fastcgi_param. So, my take on its equivalent is:


fastcgi_param db_type "mysql";

Read more
eule's picture

perusio blacklist.conf error invalid number

Hello,
here is my blacklist.conf file who i try to deny some bots, but i get the error "nginx: [emerg] invalid number of the map parameters in /etc/nginx/blacklist.conf:12"

if i do this in a server location it works fine but not with the blacklist.conf from perusio ...whats wrong??

-- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" --

This file implements a blacklist for certain user agents and

referrers. It's a first line of defense. It must be included

inside a http block.

Add here all user agents that are to be blocked.

Read more
eule's picture

how i can deny referer Spam with nginx (perusio)

hello,

i try to deny some referer Spam in some szenarios i get it working in other not. i use these locations in a drupal 7 install and this seems to work.

  location / {
     valid_referers none blocked *.kambasoft.com *.savetubevideo.com;

     if ($invalid_referer) {
    return   403;
  }
}

on the same server i have 2 preview drupal 8 sites, if i use these locations i can access the frontpage but all other pages i become a 403 nginx error.

Read more
mmncs's picture

Image styles not working with & sign

I am using perusio's nginx for my new Server which has resultet in several image style not being generated.

And I found out that it was because the filenames included the & sign.

Here is the location for image styles and sorry for the newbee question, but does this has something to do with nginx and what is it @drupal does?

## Drupal 7 generated image handling, i.e., imagecache in core. See:
## http://drupal.org/node/371374.
location ~* /files/styles/ {
    ## Image hotlinking protection. If you want hotlinking
Read more
stclaird's picture

Using Perusios nginx config works except for rewritten urls ending in .html

Hello

Apologies if this isn't the correct place to post this but I have had an odd problem

I have got perusios nginx config working on a Centos 6.5 server after a some tinkering about. Every thing works bar one issue:

my urls which end in .html

such as

http://test.princesssparkle.co.uk/wedding-hair-accessories.html

don't work and an entry in the error log is written like so

princesssparkle.co.uk/public_html/wedding-hair-accessories.html" failed (2: No such file or directory

however

http://test.princesssparkle.co.uk/wedding-collections

Read more
joneal's picture

New Content Type doesn't display on Add Content List

Hi all,

I recently moved a site from a web hosting company which uses apache servers to one which uses nginx servers.

However i have heard numerous issues with this new environment ranging from my modules failing to update, media gallery malfunction and now i have created a new content type and when i check in the add content list from Home » Administration. I can't see it.

I'd like to request for your insights on how to have the content type display in the add content list

Read more
pbuyle's picture

Nginx for Drupal using Ansible

Hi,

I'm planning to configure Nginx to serve a Drupal site. The server uses Ansible for provisioning, and I'm planning to use perusio's config. The logical way to do it would be to create a role based on perusio's config.

Has anyone been working on something similar?

Read more
Torenware's picture

Enabling CiviCRM php scripts under Perusio's drupal configuration

I'm now running a Drupal / CiviCRM site on AWS using Perusio's standard config. This mostly works fine.

The one issue I've found is that CiviMail uses a variety of PHP scripts located under sites/all/modules/civicrm/extern/ (e.g., sites/all/modules/civicrm/extern/soap.php, sites/all/modules/civicrm/extern/open.php, etc.). Short version: the CiviMail back-end needs to talk to the installed CiviCRM instance via these end points. Since the standard Perusio config only wants to talk to /index.php, I need to extend things for this specific group of scripts.

Read more
MatthijsG's picture

The "no no for private" needed when private is outside root?

Is this piece of text needed in de .conf-file when the folder for private files is outside the root?

       # No no for private
        location ~ ^/sites/.*/private/ {
                return 403;
        }

The location for private files is /home/foobar/filesprotected
The location for Drupal is /home/foobar/drupal7/
For an anonymous visitor it isn't possible to directly enter /home/foobar/filesprotected (duh .. ;-)

Read more
luxpir's picture

Adding Piwik to Apps folder - merging Perusio configs correctly

I'm trying to make use of Perusio's Piwik config alongside his Drupal config. I've copied the Piwik config files to /etc/nginx/apps/piwik/ and created a .conf file using the subdomain suggested (stats.example.com). This has the include to /apps/piwik.conf in it, as per the example conf file provided.

Do I need to add a DNS record/'officially' create a subdomain to run Piwik from that URL? If possible, I'd rather use an example.com/piwik structure, but that's proving tricky.

Read more
Subscribe with RSS Syndicate content

Nginx

Group organizers

Group notifications

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