From 8633f22c7adad5f2c97567afcd5a332bfacd7a00 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 16 Apr 2014 14:08:50 +0200 Subject: added try_files (experimental) --- blob/nginx_rewrite_rules | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'blob') diff --git a/blob/nginx_rewrite_rules b/blob/nginx_rewrite_rules index e6783f0..2c9b7f3 100755 --- a/blob/nginx_rewrite_rules +++ b/blob/nginx_rewrite_rules @@ -11,28 +11,30 @@ location /robots.txt {} #stop rewriting the robots.txt location /favicon.ico {} location /static {} -location ~* ^/?login/?([a-z0-9]+=[a-z0-9]+(&[a-z0-9]+=[a-z0-9]+)?)?$ { +try_files $uri @main; + +location ~* ^/login/?([a-z0-9]+=[a-z0-9]+(&[a-z0-9]+=[a-z0-9]+)?)?$ { rewrite ^/?login([?/]?.*) /index.php?task=login&arguments=$1 last; } -location ~* ^/?logout/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { +location ~* ^/logout/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { rewrite ^/?logout([?/]?.*) /index.php?task=logout&arguments=$1 last; } -location ~* ^/?register/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { +location ~* ^/register/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { rewrite ^/?register(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /index.php?task=register&arguments=$1 last; } -location ~* ^/?invite/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { +location ~* ^/invite/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { rewrite ^/?invite(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /index.php?task=invite&arguments=$1 last; } -location ~* ^/?user/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { +location ~* ^/user/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { rewrite ^/?user(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /index.php?task=user&arguments=$1 last; } -location ~* ^/?download/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { +location ~* ^/download/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { rewrite ^/?download(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /index.php?task=download&arguments=$1 last; } @@ -41,9 +43,9 @@ location ~* ^/password_recover/?(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ { } #location ~* \.php(\?[0-9a-zA-Z]+(=[0-9a-zA-Z]*)?)?$ {} #empty block to catch all -location / { - rewrite ^/([0-9a-zA-Z-_]+)/(.*) /index.php?name=$1&folder=$2 last; +location @main { rewrite ^/([0-9a-zA-Z-_]+)$ /index.php?name=$1&folder= last; + rewrite ^/([0-9a-zA-Z-_]+)/(.*)$ /index.php?name=$1&folder=$2 last; rewrite ^/$ /index.php last; break; } -- cgit v1.2.3