forked from arthurfurlan/nginx-config-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpeople.conf
30 lines (26 loc) · 799 Bytes
/
people.conf
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
server {
server_name people.example.com;
listen 80;
listen 443;
# redirect non personal pages
rewrite ^/?$ http://example.com last;
# userdir mapping
set $userdir 'www';
location ~ ^/~([^/]+)/(.+\.php)$ {
if (!-f /home/$1/$userdir/$2) {
rewrite ^ 404;
}
alias /home/$1/$userdir/$2;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
location ~ ^/~([^/]+)(/.*)?$ {
alias /home/$1/$userdir/$2;
autoindex on;
}
# logging
error_log /srv/people.example.com/nginx/log/access.log;
access_log /srv/people.example.com/nginx/log/access.log;
}