mcedit /etc/nginx/sites-available/test.ru server { listen 80; listen [::]:80; root /var/www/test.ru; index index.php index.html index.htm index.nginx-debian.html; server_name test.ru; rewrite ^/(.*\.php)(/)(.*)$ /$1?file=/$3 last; # для moodle location / { try_files $uri $uri/ =404; } location ~ \.php$ { fastcgi_buffer_size 32k; fastcgi_buffers 4 32k; include snippets/fastcgi-php.conf; # если у joomla в админке нет стилей и падает 404, то надо закомментировать fastcgi_pass unix:/run/php/php7.0-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~ /\.ht { deny all; } }