forked from elasticweb/nginx-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yii-advanced.conf
46 lines (37 loc) · 976 Bytes
/
yii-advanced.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
root /home/u1/domains/example.com/frontend/web;
location ^~ /backend {
rewrite ^/backend(.*)$ /backend/web$1 last;
}
location ^~ /backend/web {
root /home/u1/domains/example.com;
location ~ /\.(ht|svn|git) {
deny all;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-{domain}.sock;
}
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ ^/(protected|framework|themes/\w+/views) {
deny all;
}
location ~ /\. {
deny all;
}
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-example.com.sock;
}