Skip to content

Instantly share code, notes, and snippets.

@ProjectSoft-STUDIONIONS
Created April 30, 2019 10:44
Show Gist options
  • Save ProjectSoft-STUDIONIONS/4886ea9132a4dba198bd1cb2b2a5a4d2 to your computer and use it in GitHub Desktop.
Save ProjectSoft-STUDIONIONS/4886ea9132a4dba198bd1cb2b2a5a4d2 to your computer and use it in GitHub Desktop.
Modx Evo
server {
listen 80;
listen [::]:80;
server_name www.site.ru site.ru;
return 301 https://site.ru$request_uri;
}
server {
listen 443 http2;
listen [::]:443 http2;
ssl on;
ssl_certificate /etc/nginx/ssl/cloudflare/site.ru.origin.pem;
ssl_certificate_key /etc/nginx/ssl/cloudflare/site.ru.key.pem;
root /var/www/site.ru;
server_name www.site.ru site.ru;
access_log /var/log/nginx/site.ru-access.log;
error_log /var/log/nginx/site.ru-error.log;
index index.php;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment