Showing 1 changed files with 13 additions and 1 deletions
+13 -1
etc/nginx/sites-available/action
... ...
@@ -18,14 +18,26 @@ server {
18 18
 
19 19
 	index index.php;
20 20
 
21
-	location ~ ^/admin {
21
+	location ~ [a-zA-Z0-9]+/admin.*$ {
22 22
 		auth_basic "Halte ! Qui va la ?";
23 23
 		auth_basic_user_file /etc/nginx/htpasswd;
24
+        rewrite "^/([a-zA-Z0-9]{24})/admin$"                              "/adminstuds.php?poll=$1"         last;
25
+        rewrite "^/([a-zA-Z0-9]{24})/admin/vote/([a-zA-Z0-9]{16})$"       "/adminstuds.php?poll=$1&vote=$2" last;
26
+        rewrite "^/([a-zA-Z0-9]{24})/admin/action/([a-zA-Z_-]+)(/(.+))?$" "/adminstuds.php?poll=$1&$2=$3"   last;
24 27
 		location ~ \.php {
25 28
 			include api_fastcgi.conf;
26 29
 		}
27 30
 	}
28 31
 
32
+    location ~ /([a-zA-Z0-9]+) {
33
+        rewrite "^/([a-zA-Z0-9]+)/action/([a-zA-Z_-]+)/(.+)$" "/studs.php?poll=$1&$2=$3"        last;
34
+        rewrite "^/([a-zA-Z0-9]+)/vote/([a-zA-Z0-9]{16})"     "/studs.php?poll=$1&vote=$2"      last;
35
+        rewrite "^/([a-zA-Z0-9]+)$"                           "/studs.php?poll=$1"              last;
36
+		location ~ \.php {
37
+			include api_fastcgi.conf;
38
+		}
39
+    }
40
+
29 41
 	location ~ /(|index.php|create_poll.php?type=.+)$ {
30 42
 		auth_basic "Acces a la creation de sondage restreint...";
31 43
 		auth_basic_user_file /etc/nginx/htpasswd;