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.

NGINX 1.18 compatibility with Drupal Core 8.7.12 Sites

Posted by dnyaneshwargiri22 on March 25, 2021 at 6:35am

Hi there,
We are planning a NGINX upgrade on our production machines which is hosting a Drupal site.
Before just wanted to check and confirm compatibility of NGINX 1.18 or >NGINX 1.18 versions with current components of our application.

Components currently being used-

Drupal Core- 8.7.12
Web Server- NGINX 1.16.1
PHP-7.3.14
Database Version- 5.5.5-10.4.11-MariaDB. System MySQL, MariaDB, Percona Server, or equivalent
Operating System- Linux, NAME="Red Hat Enterprise Linux Server", VERSION="7.7 (Maipo)"

Read more
Categories:

drupal 8 nginx setup

Posted by ludo1960 on October 11, 2018 at 9:14am

Hi guys,

new to nginx so following blindly like a sheep,

using https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/ I created an example.com in /etc/nginx/sites-available/ and symlinked it from sites-enabled and have my drupal 8 in /var/www/example.com. When I go to eample.com I get a 403 but my test.php shows up just fine in example.com/test.php as does my example.com/adminer.php so it's nearly right. Is there something I need to change in nginx.conf to get drupal 8 to work?

PS everything in var/www/ is owned by www-data, so I dont know what else to try?

Thanks

Read more
11 comments Categories:

drupal 8 + nginx + centos 7

Posted by mnovoa on March 8, 2018 at 2:57pm

Hello

Install drupal 8 on nginx in a centos 7 server. I did not have problems in the installation, but only the front page works.

Any page of the type:

user / login
content / add
admin / themes
etc.

it shows me a "not found", I suppose it is an error in the rule of the rewite of the nginx.

Does anyone have an example of how to configure ?, or if I have to review something else.

thanks for the help from now

Read more
11 comments Categories: , ,

Pages crawled by recacher are not cached

Posted by macdev_drupal on February 22, 2017 at 10:39pm

I am trying to us recacher / httprl to load expired/purged pages into the nginx micro cache.
So far all expired pages are crawled by git requests as can be seen in nginx and apache logs.
As soon as I hit a recached page in the browser, it is completely reloaded from apache and not from the cache.

I too use wget to pre fill the cache by spidering the site. Those wget requests are cached in the micro cache and a browser gets a page from the cache.

Up to now I couldn't identify a big difference between the httprl and wget requests - they are both get requests, no-proxy used... .

Read more
Categories: ,

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

Posted by heyyo on June 20, 2016 at 5:17pm

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

D8 +nginx Error installing anything

Posted by Sakura777 on April 20, 2016 at 2:02pm

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
ResponseText:
403 Forbidden
403 Forbidden
nginx/1.9.10

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

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

Posted by spacereactor on March 14, 2016 at 4:48am

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 https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/

======================================
IMPORTANT
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

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

Posted by renukakulkarni on February 25, 2016 at 9:35am

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

Drupal 8 update.php/selection - Access Denied

Posted by odili on January 28, 2016 at 1:56pm

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 https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/, PHP 7.0.2

Read more

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

Posted by rkudyba on January 21, 2016 at 5:26pm

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

Posted by Anonymous on January 5, 2016 at 5:41pm

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,

frontend:

server {
server_name dev.example.com;

Read more
Anonymous's picture

mixture of drupal and non-drupal sites with Perusio config

Posted by Anonymous on October 17, 2015 at 9:49am

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

Drupal path problem with nginx/1.9.5

Posted by Nikdhil Mdohfan on October 5, 2015 at 4:10am

I am trying to install drupal on nginx 1.9.5
here is my default.conf http://pastebin.com/4hTBnSJf

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

its like

@import url("http://192.168.52.211/modules/system/system.base.css?0");
@import url("http://192.168.52.211/modules/system/system.admin.css?0");
@import url("http://192.168.52.211/modules/system/system.menus.css?0");
@import url("http://192.168.52.211/modules/system/system.messages.css?0");
@import url("http://192.168.52.211/modules/system/system.theme.css?0");

Read more
1 comment1 attachment Categories:

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

Posted by hkvega01 on September 25, 2015 at 12:00pm

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;
 server_name www.example.com example.com;
 access_log /var/log/virtualmin/example.com_nginx_access_log;
 error_log /var/log/virtualmin/example.com_nginx_error_log;
 location / {
 index index.php;
proxy_pass http://192.168.1.104:8086;
 include /etc/nginx/proxy.conf;
Read more
Anonymous's picture

Image styles when imported from apache not creating

Posted by Anonymous on June 4, 2015 at 3:42pm

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
18 comments Categories:

Simple SPDY config not working

Posted by luxpir on May 1, 2015 at 1:12pm

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
Anonymous's picture

Issue with Image styles where spaces in image title

Posted by Anonymous on March 31, 2015 at 11:37am

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
Categories:

Tutorial to tune php-fpm

Posted by haunted on February 28, 2015 at 8:35pm

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
Categories:
Subscribe with RSS Syndicate content

Nginx

Group organizers

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /