forked from elasticweb/nginx-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
umi-cms.conf
80 lines (63 loc) · 1.79 KB
/
umi-cms.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
root /home/u1/domains/example.com;
client_max_body_size 25m;
location ~* \/\.ht {
deny all;
}
location ~* ^\/(classes|errors\/logs|sys\-temp|cache|xmldb|static|packages) {
deny all;
}
location ~* (\/for_del_connector\.php|\.ini|\.conf)$ {
deny all;
}
location ~* ^(\/files\/|\/images\/|\/yml\/) {
try_files $uri =404;
}
location ~* ^\/images\/autothumbs\/ {
try_files $uri @autothumbs =404;
}
location @autothumbs {
rewrite ^\/images\/autothumbs\/(.*)$ /autothumbs.php?img=$1$query_string last;
}
location @clean_url {
rewrite ^/(.*)$ /index.php?path=$1 last;
}
location @dynamic {
try_files $uri @clean_url;
}
location \/yml\/files\/ {
try_files $uri =404;
}
location / {
rewrite ^\/robots\.txt /sbots_custom.php?path=$1 last;
rewrite ^\/sitemap\.xml /sitemap.php last;
rewrite ^\/\~\/([0-9]+)$ /tinyurl.php?id=$1 last;
rewrite ^\/(udata|upage|uobject|ufs|usel|ulang|utype|umess|uhttp):?(\/\/)?(.*)? /releaseStreams.php?scheme=$1&path=$3 last;
rewrite ^\/(.*)\.xml$ /index.php?xmlMode=force&path=$1 last;
rewrite ^(.*)\.json$ /index.php?jsonMode=force&path=$1 last;
if ($cookie_umicms_session) {
error_page 412 = @dynamic;
return 412;
}
if ($request_method = 'POST') {
error_page 412 = @dynamic;
return 412;
}
index index.php;
try_files $uri @dynamic;
}
location ~* \.js$ {
rewrite ^\/(udata|upage|uobject|ufs|usel|ulang|utype|umess|uhttp):?(\/\/)?(.*)? /releaseStreams.php?scheme=$1&path=$3 last;
try_files $uri =404;
}
location ~* \.(ico|jpg|jpeg|png|gif|swf|css|ttf)$ {
try_files $uri =404;
access_log off;
expires 24h;
}
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;
}