Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal 8 needs slightly different rewrite method when sending requests to /index.php
than previous Drupal versions:
rewrite ^ /index.php?$query_string last;
In fact, the same new method works for Drupal 7, but we are still using Drupal 6 and Drupal 5 compatible style:
rewrite ^/(.*)$ /index.php?q=$1 last;
The problem is, the D5/D6 style causes weird problems with Drupal 8, as documented in this issue: https://github.com/pantheon-systems/drops-8/issues/105
Comment | File | Size | Author |
---|---|---|---|
#2 | 0001-Issue-2843473-by-memtkmcc-Nginx-Use-Drupal-8-friendl.patch | 3.64 KB | memtkmcc |
Comments
Comment #2
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedAttached patch should fix the problem, since it is detecting Drupal 7 or newer specific HTTP header received from the PHP backend to switch to the correct rewrite style. Not tested yet, though.
Comment #3
colanCan we remove these stanzas instead of commenting them out? Or are they temporary while you're testing?
The rest seems to match what's in https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/ so that's good.
Comment #4
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedSure, I forgot to switch branches before exporting the patch, apparently.
Comment #5
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedI have looked at this again, and I think it is OK to leave the commented out lines as proposed, because they are config examples useful when someone wants to override named location in the included extra config file to restore the previously enabled bots filtering.
Comment #6
colanComment #8
memtkmcc CreditAttribution: memtkmcc at Omega8.cc commentedThanks for the review! Patch committed.