-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwww.conf
67 lines (56 loc) · 2.24 KB
/
www.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
server {
listen 80;
server_name www.kamwing.net kamwing.net;
#access_log /usr/share/nginx/www/kamwing.net/logs/access.log;
access_log off;
error_log /usr/share/nginx/www/kamwing.net/logs/error.log;
root /usr/share/nginx/www/kamwing.net/public_html;
location / {
index index.html index.htm index.php;
### Serve static files directly
if (-f $request_filename) {
access_log off;
expires 30d;
break;
}
### BACKEND
if ($request_filename ~ /symphony/) {
rewrite ^/symphony/?$ /index.php?mode=administration&$query_string last;
rewrite ^/symphony(/(.*/?))?$ /index.php?symphony-page=$1&mode=administration&$query_string last;
}
###modify backend to admin
if ($request_filename ~ /admin/) {
rewrite ^/admin/?$ /index.php?mode=administration&$query_string last;
}
### MINIFY REWRITE
if ($request_filename ~ /min/) {
rewrite ^/min/([a-z]=.*) /min/index.php?$1 last;
}
### IMAGE RULES
rewrite ^/image/(.+\.(jpg|gif|jpeg|png|bmp|ico|JPG|GIF|JPEG|PNG|BMP|ICO))$ /extensions/jit_image_manipulation/lib/image.php?param=$1 last;
### CHECK FOR TRAILING SLASH - Will ignore files
if (!-f $request_filename) {
rewrite ^/(.*[^/]+)$ /$1/ permanent;
}
### LANGUAGE REDIRECT RULES
if (!-f $request_filename) {
rewrite ^/(zh|en)-?()?/(.*/?)$ /index.php?fl-language=$1&fl-region=$2&symphony-page=$3&$query_string last;
}
### MAIN REWRITE - This will ignore directories
if (!-d $request_filename) {
rewrite ^/(.*)$ /index.php?symphony-page=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
access_log off;
log_not_found off;
deny all;
}
}