• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Input NGINX-Configuration for Drupal 8.X without Apache for Plesk Obsidian | Ubuntu 18.X

Kulturmensch

Regular Pleskian
Usually the combination of NGINX as Proxy for Apache works fine for Drupal 8 in Plesk but for those who would like to use NGINX solo you will find this recipe on www.nginx.com: Drupal | NGINX But this does unfortunately not work without modifications for Plesk managed server.

You need some modifications as mentioned below. You can use the following configuration for NGINX in Plesk - which works fine in my case. Applying this you must just take care of

fastcgi_pass unix:/var/run/plesk/plesk-php74-fpm.sock;

This works for me as I use php 7.4 but depends on your configuration concerning php.


#NGINX configuration start
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_static on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types application/javascript application/rss+xml application/vnd.ms-fontobject application/x-font application/x-font-opentype application/x-font-otf application/x-font-truetype application/x-font-ttf application/x-javascript application/xhtml+xml application/xml font/opentype font/otf font/ttf image/svg+xml image/x-icon text/css text/javascript text/plain text/xml;

location ~ / {
index index.php index.cgi index.pl index.html index.xhtml index.htm index.shtml;
try_files $uri $uri/ /index.php$is_args$args;
}

location ~ \..*/.*\.php$ {
return 403;
}

location ~ ^/sites/.*/private/ {
return 403;
}

location ~ ^/sites/[^/]+/files/.*\.php$ {
deny all;
}

location ~* ^/.well-known/ {
allow all;
}

location ~ (^|/)\. {
return 403;
}

location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}

location ~ /vendor/.*\.php$ {
deny all;
return 404;
}

location ~ '\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
include fastcgi_params;
fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/plesk/plesk-php74-fpm.sock; #(depends on your configuration)
}

location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}

location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}

if ($request_uri ~* "^(.*/)index\.php(.*)") {
return 307 $1$2;
}
#NGINX configuration end


Please find following the additional settings for plesk
1581590151430.png



I hope, this recipe saves time. In case there are proposals for modifications I would be glad to hear it and to optimize my recipe further.
 
Thank you IgorG, I have transfered it as proposed. As it is my first contribution to your ressources please feel free to tell me If my post there is ok as it is?
 
Thank you IgorG, I have transfered it as proposed. As it is my first contribution to your ressources please feel free to tell me If my post there is ok as it is?
I'd suggest you to use CODE for better code formatting. I mean something like that :

Code:
Code text here
 
Back
Top