error_page 401 403 404 /httperror.php?e=40x; error_page 500 502 504 /httperror.php?e=50x; location /robots.txt {} #stop rewriting the robots.txt location /favicon.ico {} location /static {} #location ~* ^/.+[^/].+\.css {} #location ~* ^/.+[^/].+\.png {} 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]*)?)?$ { rewrite ^/?logout([?/]?.*) /index.php?task=logout&arguments=$1 last; } 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]*)?)?$ { 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]*)?)?$ { rewrite ^/?user(\?[0-9a-zA-Z]*(=[0-9a-zA-Z]*)?)? /index.php?task=user&arguments=$1 last; } #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; rewrite ^/([0-9a-zA-Z-_]+)$ /index.php?name=$1 last; rewrite ^/$ /index.php last; break; }