Skip to content

Instantly share code, notes, and snippets.

@wlatt1991
Forked from diproart/modx-evo.nginx
Created December 22, 2019 14:28
Show Gist options
  • Select an option

  • Save wlatt1991/b49fe96aca7a6873c08992db4241f677 to your computer and use it in GitHub Desktop.

Select an option

Save wlatt1991/b49fe96aca7a6873c08992db4241f677 to your computer and use it in GitHub Desktop.
# modx evolution
# @version 1.0.0
server {
set $domain mysite.com;
set $id user;
listen 80;
server_name $domain;
root /home/$id/projects/$domain/www;
index index.php index.html;
charset utf-8;
source_charset utf-8;
client_max_body_size 1024M;
client_body_buffer_size 4M;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block;";
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\.ht {
deny all;
log_not_found off;
access_log off;
}
location / {
autoindex on;
index index.php index.html;
root /home/$id/projects/$domain/www;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
#try_files $uri $uri/ = 404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_param SERVER_NAME $host;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment