server server_name hg pydev ru root web location if request_method POS

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
server {
server_name .hg.pydev.ru;
root /web;
location / {
if ($request_method = POST) {
rewrite (.*) /__post$1 last;
}
if ($request_method != POST) {
rewrite (.*) /__get$1 last;
}
}
location ~ ^/__get {
rewrite ^/__get(.*) $1 break;
include fastcgi_params;
fastcgi_param PATH_INFO $uri;
fastcgi_param SCRIPT_NAME '';
fastcgi_pass unix:/var/run/www/hg.pydev.ru.sock;
}
location ~ ^/__post {
auth_basic "closed site";
auth_basic_user_file /web/hg.passwd;
rewrite ^/__post(.*) $1 break;
include fastcgi_params;
fastcgi_param PATH_INFO $uri;
fastcgi_param SCRIPT_NAME '';
fastcgi_param REMOTE_USER $remote_user;
fastcgi_pass unix:/var/run/www/hg.pydev.ru.sock;
}
}