-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
41 lines (30 loc) · 1.38 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
#多个域名时配置主域名
# if ( $host != "ireoo.com") {
# rewrite ^/(.*)$ http://ireoo.com/$1 permanent;
# }
# 伪静态规则
rewrite "/([0-9]+)\.html$" /index.php?page=store&id=$1 last;
rewrite "/([0-9]+)\-([0-9]+)\.html$" /index.php?page=store&id=$1&l=$2 last;
rewrite "/([0-9]+)\-([a-z]+)\.html$" /index.php?page=store&p=$2&id=$1 last;
rewrite "/([0-9]+)\-([a-z]+)\-([0-9]+)\.html$" /index.php?page=store&p=$2&id=$1&l=$3 last;
rewrite "/([a-z]+)\-([0-9]+)\.html$" /index.php?page=$1&l=$2 last;
rewrite "/([a-z]+)_([0-9]+)\.html$" /index.php?page=$1&id=$2 last;
rewrite "/([a-z]+)\-([a-z]+)\.html$" /index.php?page=$1&p=$2 last;
rewrite "/([a-z]+)\-([a-z]+)\-([0-9]+)\.html$" /index.php?page=$1&p=$2&start=$3 last;
rewrite "/(.*)\.html$" /index.php?page=$1 last;
rewrite "/([^index])\.php$" /404.html last;
rewrite "/user\/([0-9]+)\.jpg$" /upload/user/$1.jpg last;
rewrite "/store\/([0-9]+)\.jpg$" /upload/store/$1.jpg last;
if ( $host ~* (new|product|service)\.ireoo\.com ) {
set $page $1;
rewrite "/([0-9]+)\.html$" /index.php?page=$page&id=$1 last;
}
if ( $host ~* ([0-9]+)\.ireoo\.com ) {
set $store $1;
rewrite "/(new|product|photo)?\.html$" /index.php?page=store&id=$store&p=$1 last;
}
if ( $host ~* (www|w)?\.ireoo\.com ) {
set $site $1;
rewrite "/([0-9]+)/?(new|product|photo)?\.html$" /index.php?page=store&id=$1&p=$2 last;
rewrite "/([a-zA-Z]+)\.html$" /index.php?page=$1 last;
}