Created
October 28, 2013 17:21
-
-
Save pik4ez/7200888 to your computer and use it in GitHub Desktop.
MODx Revo 2.2 nginx config.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name modx.local; | |
charset utf-8; | |
error_log /var/log/nginx/modx.error.log; | |
access_log /var/log/nginx/modx.access.log; | |
root /var/www/modx; | |
client_max_body_size 30M; | |
index index.php; | |
location / { | |
try_files $uri $uri/ @rewrite; | |
} | |
location @rewrite { | |
rewrite ^/(.*)$ /index.php?q=$1; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_pass unix:/run/php-fpm/php-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_ignore_client_abort on; | |
fastcgi_param SERVER_NAME $http_host; | |
} | |
location ~* ^/core/ { | |
deny all; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|bmp)$ { | |
access_log off; | |
expires 10d; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment