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