Nginx provided in its documentation a configuration for Drupal :

https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/

but this configuration is incomplete, it lacks gzip, Expires headers, ...

It will be time to create a page in the Drupal documentation with an equivalent of htaccess.

More and more servers are migrating to Nginx.

Comments

zenimagine created an issue. See original summary.

cilefen’s picture

Title: It is urgent to provide the configuration for Nginx » Provide the official configuration for Nginx
Category: Support request » Task

In my opinion it makes sense to correct https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/ rather than publish a correct official documentation in one place and an incorrect one in another, both considered "official". That will be confusing. At the very least if a more managed and correct documented configuration is on Drupal.org, https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/ should link to it instead of being wrong.

cilefen’s picture

Issue tags: +nginx

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

zeroagain’s picture

It's of utmost importance to have an official NGINX configuration of Drupal.

mstrelan’s picture

While there is nothing official on Drupal.org, please submit PRs to nginxinc/nginx-wiki.

dadangnh’s picture

I found out that Layout Builder on Drupal 8 - 9 is not working when we use nginx with this recipe: https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/

It's also not work on PHP Development Server (via: php -S 127.0.0.1:8000 -t web/), I use PHP 7.4.3.

Everything is fine on Apache though.

cilefen’s picture

@dadangnh Actually .ht.router.php is the proper way to execute the PHP dev server. See the comment at the top of .ht.router.php for how to use it.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

cilefen’s picture

Status: Active » Closed (duplicate)
Related issues: +#2937161: Provide documentation/default server block for Nginx server.