forked from bzfshop-net/bzfshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
68 lines (52 loc) · 1.75 KB
/
nginx.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
###########################################################################
### demo.bzfshop.net
###########################################################################
server {
listen 80;
server_name demo.bzfshop.net ;
access_log /var/log/nginx/demo.bzfshop.net.access.log;
error_log /var/log/nginx/demo.bzfshop.net.error.log;
root /var/www/demo.bzfshop.net/src;
index index.html index.htm index.php;
rewrite ^/mobile$ /mobile/Mobile/Index redirect;
rewrite ^/manage$ /manage/Manage/Index redirect;
rewrite ^/supplier$ /supplier/Supplier/Index redirect;
rewrite ^/install$ /install/Install/Index redirect;
location /protected {
deny all;
}
location /console {
deny all;
}
location /mobile {
try_files $uri /mobile/index.php$is_args$args;
}
location /manage {
try_files $uri /manage/index.php$is_args$args;
}
location /supplier {
try_files $uri /supplier/index.php$is_args$args;
}
location /install {
try_files $uri /install/index.php$is_args$args;
}
location / {
try_files $uri /index.php$is_args$args;
}
## deny all php file in /data or asset dir for security consideration
location ~ ^(/data|/asset|/mobile/asset|/manage/asset|/supplier/asset)(.+)\.php$ {
deny all;
}
## run only index.php for security consideration
location ~ ^(/index.php|/mobile/index.php|/manage/index.php|/supplier/index.php|/install/index.php)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
## bzfshop has a perfect asset/resouce manage policy, it would change url if asset/resouce update
## so there is no need to refresh any resource file in bzfshop, set cache forever,
location ~ .*\.(gif|jpe?g|png|bmp|swf|js|css|ico)(\?.*)?$
{
expires max;
}
}