From 6aed76192eee99a4f715f141273fee18e54a601d Mon Sep 17 00:00:00 2001 From: lunarok Date: Mon, 9 Jun 2014 13:57:09 +0200 Subject: [PATCH 1/2] Add rewrite rules for permalinks Change try rule to a rewrite rules on non-existing file so the permalink can be working without being ssoed --- conf/nginx.conf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 697e90f..90936aa 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,8 +4,11 @@ location PATHTOCHANGE { rewrite ^ https://$server_name$request_uri? permanent; } index index.php; - try_files $uri $uri/ /index.php?$args; - location ~ [^/]\.php(/|$) { + if (!-e $request_filename) + { + rewrite ^(.+)$ PATHTOCHANGE/index.php?q=$1 last; + } + location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; From 9fad623b125c6f892c5efe02b69cde412bc5499a Mon Sep 17 00:00:00 2001 From: lunarok Date: Mon, 9 Jun 2014 13:57:42 +0200 Subject: [PATCH 2/2] Add rewrite rules for permalinks Change try rule to rewrite rule so the permalinks are working without being ssoed --- conf/nginx.conf-public | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf-public b/conf/nginx.conf-public index 44245c4..19c5077 100644 --- a/conf/nginx.conf-public +++ b/conf/nginx.conf-public @@ -1,7 +1,10 @@ location PATHTOCHANGE { alias ALIASTOCHANGE; index index.php; - try_files $uri $uri/ /index.php?$args; + if (!-e $request_filename) + { + rewrite ^(.+)$ PATHTOCHANGE/index.php?q=$1 last; + } location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php5-fpm.sock;