nginx でmodx のFriendly URL をrewrite

まだ十分理解できているわけではないので、最適解かといわれると疑問がのこるが、とりあえずは動いているということで、

server {
server_name cubie2.example.com;
access_log /srv/www/site1/logs/access.log;
error_log /srv/www/site1/logs/error.log;
root /srv/www/site1/public;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args @modx;
}
location @modx {
rewrite ^/(.*)$ /index.php?q=$1&$args;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
.
.
.

}

リライトには3回パスをとおしている、ということかな?

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.