-
Notifications
You must be signed in to change notification settings - Fork 0
/
datalife-config-for-nginx
108 lines (80 loc) · 3.89 KB
/
datalife-config-for-nginx
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
server {
listen 80;
server_name aliyoonesi.info www.aliyoonesi.info;
root /var/www/aliyoonesi.info;
index index.php index.html index.htm;
#location / {
# try_files $uri $uri/ =404;
#}
location / {
rewrite ^/page/(.*)$ /index.php?cstart=$1;
rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/page,([0-9]+),([0-9]+),(.*).html*$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6;
rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/page,([0-9]+),(.*).html*$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5;
rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/print:page,([0-9]+),(.*).html*$ /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5;
rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/(.*).html*$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4;
rewrite ^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)$ /index.php?newsid=$4&news_page=$2&cstart=$3;
rewrite ^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)$ /index.php?newsid=$3&news_page=$2;
rewrite ^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)$ /engine/print.php?news_page=$2&newsid=$3;
rewrite ^/([^.]+)/([0-9]+)-(.*).html(/?)$ /index.php?newsid=$2;
rewrite ^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$3&news_page=$1&cstart=$2;
rewrite ^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$2&news_page=$1;
rewrite ^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /engine/print.php?news_page=$1&newsid=$2;
rewrite ^/([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$1;
rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/page/([0-9]+)(.*)$ /index.php?year=$1&month=$2&day=$3&cstart=$4;
rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)(.*)$ /index.php?year=$1&month=$2&day=$3;
rewrite ^/([0-9]+)/([0-9]+)/page/([0-9]+)(.*)$ /index.php?year=$1&month=$2&cstart=$3;
rewrite ^/([0-9]+)/([0-9]+)(.*)$ /index.php?year=$1&month=$2;
rewrite ^/([0-9]+)/page/([0-9]+)(.*)$ /index.php?year=$1&cstart=$2;
rewrite ^/([0-9]+)(.*)$ /index.php?year=$1;
rewrite ^/catalog/([^/]*)/page/([0-9]+)(.*)$ /index.php?catalog=$1&cstart=$2;
rewrite ^/catalog/([^/]*)(.*)$ /index.php?catalog=$1;
rewrite ^/newposts/page/([0-9]+)(.*)$ /index.php?subaction=newposts&cstart=$1;
rewrite ^/newposts(.*)$ /index.php?subaction=newposts;
rewrite ^/static/(.*).html(.*)$ /index.php?do=static&page=$1;
rewrite ^/user/([^/]*)/news/page/([0-9]+)(.*)$ /index.php?subaction=allnews&user=$1&cstart=$2;
rewrite ^/user/([^/]*)/news(.*)$ /index.php?subaction=allnews&user=$1;
rewrite ^/user/([^/]*)(.*)$ /index.php?subaction=userinfo&user=$1;
rewrite ^/favorites /index.php?do=favorites;
rewrite ^/favorites/page/(.*)$ /index.php?do=favorites&cstart=$1;
rewrite ^/statistics.html$ /index.php?do=stats;
rewrite ^/addnews.html(.*)$ /index.php?do=addnews;
rewrite ^/rss.xml$ /engine/rss.php;
rewrite ^/sitemap.xml$ uploads/sitemap.xml;
if (!-d $request_filename) {
rewrite ^/([^.]+)/page/([0-9]+)(.*)$ /index.php?do=cat&category=$1&cstart=$2;
rewrite ^/([^.]+)/*$ /index.php?do=cat&category=$1;
}
if (!-f $request_filename) {
rewrite ^/([^<]+)/rss.xml$ /engine/rss.php?do=cat&category=$1;
rewrite ^/page,([0-9]+),([^/]+).html$ /index.php?do=static&page=$2&news_page=$1;
rewrite ^/([^/]+).html$ /index.php?do=static&page=$1;
}
try_files $uri $uri/ =404;
}
location /xfsearch {
rewrite ^/xfsearch/([^/]*)/*$ /index.php?do=xfsearch&xf=$1;
rewrite ^/xfsearch/([^/]*)/page/([0-9]+)/*$ /index.php?do=xfsearch&xf=$1&cstart=$2;
}
location ~ /\.svn {
deny all;
}
location ~ /\.git {
deny all;
}
location ~ /\.hg {
deny all;
}
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
location ~* (engine/cache) {
deny all;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}