forked from lincanbin/Carbon-Forum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
25 lines (25 loc) · 1.43 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
# nginx configuration
error_page 404 /404.php;
rewrite ^([^\.]*)/dashboard$ $1/dashboard.php;
rewrite ^([^\.]*)/favorites(/page/([0-9]*))?$ $1/favorites.php?page=$3 last;
rewrite ^([^\.]*)/json/([0-9a-z_-]+)$ $1/json.php?action=$2 last;
rewrite ^([^\.]*)/login$ $1/login.php;
rewrite ^([^\.]*)/manage$ $1/manage.php;
rewrite ^([^\.]*)/new$ $1/new.php;
rewrite ^([^\.]*)/notifications$ $1/notifications.php;
rewrite ^([^\.]*)/page/([0-9]+)$ $1/index.php?page=$2 last;
rewrite ^([^\.]*)/register$ $1/register.php;
rewrite ^([^\.]*)/reply$ $1/reply.php;
rewrite ^([^\.]*)/robots.txt$ $1/robots.php;
rewrite ^([^\.]*)/search.xml$ $1/open_search.php;
rewrite ^([^\.]*)/search/(.*?)(/page/([0-9]*))?$ $1/search.php?keyword=$2&page=$4 last;
rewrite ^([^\.]*)/settings$ $1/settings.php;
rewrite ^([^\.]*)/sitemap-(topics|pages|tags|users|index)(-([0-9]+))?.xml$ $1/sitemap.php?action=$2&page=$4 last;
rewrite ^([^\.]*)/t/([0-9]+)(-([0-9]*))?$ $1/topic.php?id=$2&page=$4 last;
rewrite ^([^\.]*)/tag/(.*?)(/page/([0-9]*))?$ $1/tag.php?name=$2&page=$4 last;
rewrite ^([^\.]*)/tags/following(/page/([0-9]*))?$ $1/favorite_tags.php?page=$3 last;
rewrite ^([^\.]*)/u/(.*?)$ $1/user.php?username=$2 last;
rewrite ^([^\.]*)/users/following(/page/([0-9]*))?$ $1/favorite_users.php?page=$3 last;
rewrite ^([^\.]*)/upload_controller$ $1/upload_controller.php;
#QSA is automatic in nginx.
rewrite ^([^\.]*)/view-(desktop|mobile)$ $1/view.php?view=$2 last;