Dino Geek, try to help you

How to use nginx performance settings on Drupal 8?


To use Nginx performance settings on Drupal 8, follow these steps:

1. Edit the Nginx configuration file for your Drupal site. This file is typically located at /etc/nginx/sites-available/default or /etc/nginx/nginx.conf.

1. Add the following settings to the http block:

```
http { … # Enable Nginx caching proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=drupal_cache:10m inactive=60m; proxy_cache_key “$scheme$request_method$host$request_uri”;

# Increase the size of client request headers proxy_buffer_size 128k; client_header_buffer_size 128k; # Increase the size of client request body client_max_body_size 10M; # Enable Gzip compression gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; } ```

1. Edit the server block for your Drupal site and add the following settings:

```
server { … # Set the root directory of your Drupal site root /var/www/html/drupal;

# Enable pretty URLs if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } # Enable Nginx caching proxy_cache_bypass $http_pragma; proxy_cache_revalidate on; proxy_cache_valid 200 60m; proxy_cache_valid 404 1m; # Enable Gzip compression gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; # Increase the timeout for PHP scripts fastcgi_read_timeout 300; … } ```

1. Save the configuration file and restart Nginx:

```
sudo service nginx restart
```

These settings should improve the performance of your Drupal site by enabling caching, compressing data, and increasing timeouts. Make sure to test your site after making these changes to ensure that everything is working correctly.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use