• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

How to create a custom template for nginx & PHP-FPM for "special" websites?

Polmonino

Basic Pleskian
I manly use Symfony 2 as PHP framework. It works without problems with Apache/FastCGI. I'd like to use it with nginx/PHP-FM for low memory usage and high performance (Zend OPCache).

However, Plesk-generated default nginx configuraton is not suitable for Symfony 2. This is a minimal working configuration:

Code:
server {
    server_name domain.tld www.domain.tld;
    root /var/www/project/web;

    location / {
        # prova a servire direttamente i file, fallback su riscrittura
        try_files $uri @rewriteapp;
    }

    location @rewriteapp {
        # riscrittura di tutto su app.php
        rewrite ^(.*)$ /app.php/$1 last;
    }

    location ~ ^/(app|app_dev|config)\.php(/|$) {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }

    error_log /var/log/nginx/project_error.log;
    access_log /var/log/nginx/project_access.log;
}

I cannot use the / location because generated nginx configuration already defines / (you'll get an error if you try to paste the location in additional nginx directives). So, how can I use a custom nginx.conf for "special" project like Symfony 2? Is there any way to define a custom template (like nginxDomainVirtualHostSymfony.php) and select it from Plesk web interface?
 
Back
Top