diff --git a/conf/nginx.conf b/conf/nginx.conf index e55f050..56d6c10 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,6 +9,15 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } + rewrite "^__PATH__/([a-zA-Z0-9-]+)$" "__PATH__/studs.php?poll=$1"; + rewrite "^__PATH__/([a-zA-Z0-9-]+)/action/([a-zA-Z_-]+)/(.+)$" "__PATH__/studs.php?poll=$1&$2=$3"; + rewrite "^__PATH__/([a-zA-Z0-9-]+)/vote/([a-zA-Z0-9]{16})$" "__PATH__/studs.php?poll=$1&vote=$2"; + + # Admin requires the private poll ID, 24-char long + rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin$" "__PATH__/adminstuds.php?poll=$1"; + rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin/vote/([a-zA-Z0-9]{16})$" "__PATH__/adminstuds.php?poll=$1&vote=$2"; + rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin/action/([a-zA-Z_-]+)(/(.+))?$" "__PATH__/adminstuds.php?poll=$1&$2=$4"; + index index.php; try_files $uri $uri/ /index.php; location ~ [^/]\.php(/|$) {