initial commit
|
1 |
server { |
2 |
listen 80; |
|
3 |
server_name action.paris12.pcf.fr; |
|
4 |
return 301 https://$server_name$request_uri; |
|
5 |
} |
|
6 | ||
7 |
server { |
|
8 |
listen 443 ssl; |
|
9 |
server_name action.paris12.pcf.fr; |
|
10 | ||
11 |
access_log /var/log/nginx/action/access.log; |
|
12 |
error_log /var/log/nginx/action/error.log; |
|
13 | ||
14 |
ssl_certificate /etc/letsencrypt/live/action.paris12.pcf.fr/fullchain.pem; |
|
15 |
ssl_certificate_key /etc/letsencrypt/live/action.paris12.pcf.fr/privkey.pem; |
|
16 | ||
17 |
root /var/www/action; |
|
18 | ||
19 |
index index.php; |
|
20 | ||
réecriture action
|
21 |
location ~ [a-zA-Z0-9]+/admin.*$ { |
initial commit
|
22 |
auth_basic "Halte ! Qui va la ?"; |
23 |
auth_basic_user_file /etc/nginx/htpasswd; |
|
réecriture action
|
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; |
|
initial commit
|
27 |
location ~ \.php { |
28 |
include api_fastcgi.conf; |
|
29 |
} |
|
30 |
} |
|
31 | ||
réecriture action
|
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 | ||
initial commit
|
41 |
location ~ /(|index.php|create_poll.php?type=.+)$ { |
42 |
auth_basic "Acces a la creation de sondage restreint..."; |
|
43 |
auth_basic_user_file /etc/nginx/htpasswd; |
|
44 |
location ~ \.php { |
|
45 |
include api_fastcgi.conf; |
|
46 |
} |
|
47 |
} |
|
48 | ||
49 |
location ~ \.php { |
|
50 |
include api_fastcgi.conf; |
|
51 |
} |
|
52 |
} |