From 6aed76192eee99a4f715f141273fee18e54a601d Mon Sep 17 00:00:00 2001 From: lunarok Date: Mon, 9 Jun 2014 13:57:09 +0200 Subject: [PATCH] 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;