server {
listen 80;
listen 443 ssl http2;
ssl_certificate /cert.crt;
ssl_certificate_key /key.key;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 80;
listen 443 ssl http2;
ssl_certificate /cert.crt;
ssl_certificate_key /key.key;
server_name example.com;
index index.html index.htm index.php index.cgi index.pl index.xhtml;
location ~ /\. { internal; }
location / { rewrite ^([^.\?]*[^/])$ $1/ permanent; }
location /odminka/ { }
location /guide { }
try_files $uri $uri/ /index.php/$uri;
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
}
Это конечно минималочка, но должно запахать. У меня конечно виртуальные хосты значительно жирнее, но оно должно быть уместно. Если требуется могу помочь сделать более индивидуальный виртуальный хост.