The backend uses the thinkphp3.2.3 framework. If you are using other languages, please make appropriate changes. server { listen 80; server_name www.morgen.club; #charset koi8-r; #access_log logs/host.access.log main; Website root directory location / { root html; index index.html index.htm; #Set the access device set $source_device 'index'; #Judge whether it is a mobile client or iPad if ($http_user_agent ~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)) { set $source_device 'phone'; } #root directoryif ($request_uri ~* ^/$){ rewrite ^(.*)$ /index.php?s=/Home/$source_device/index.html last; break; } #Computer homepageif ($request_uri ~* ^/Home/index/index.html$) { rewrite ^/Home/index/index.html$ /web/ permanent; break; } #Computer home page paging if ($request_uri ~* ^/Home/index/index/page/(\d*).html$) { rewrite ^/Home/index/index/page/(\d*).html$ /web/pages/$1/ permanent; break; } #Computer home page Category home page if ($request_uri ~* ^/Home/index/index/cate/(\d*).html$) { rewrite ^/Home/index/index/cate/(\d*).html$ /web/cates/$1/ permanent; break; } #Computer home page category paging if ($request_uri ~* ^/Home/index/index/cate/(\d*)/page/(\d*).html$) { rewrite ^/Home/index/index/cate/(\d*)/page/(\d*).html$ /web/cates/$1/pages/$2/ permanent; break; } #Computer home page search if ($request_uri ~* ^/Home/index/index.html(.*)) { rewrite ^/Home/index/index.html(.*) /web/search?$query_string permanent; break; } #Computer book page if ($request_uri ~* ^/Home/index/books/book/(\d*).html$) { rewrite ^/Home/index/books/book/(\d*).html$ /web/books/$1/ permanent; break; } #Computer chapter page if ($request_uri ~* ^/Home/index/contents/books/(\d*)/chapters/(\d*).html$) { rewrite ^/Home/index/contents/books/(\d*)/chapters/(\d*).html$ /web/books/$1/chapters/$2/ permanent; break; } #Mobile homepageif ($request_uri ~* ^/Home/phone/index.html$) { rewrite ^/Home/phone/index.html$ /phone/ last; break; } #Mobile home page paging if ($request_uri ~* ^/Home/phone/index/page/(\d*)(.*)$) { rewrite ^/Home/phone/index/page/(\d*).html /phone/pages/$1/ permanent; break; } #Mobile home page Category home page if ($request_uri ~* ^/Home/phone/index/cate/(\d*).html$) { rewrite ^/Home/phone/index/cate/(\d*).html$ /phone/cates/$1/ permanent; break; } #Mobile home page category paging if ($request_uri ~* ^/Home/phone/index/cate/(\d*)/page/(\d*).html$) { rewrite ^/Home/phone/index/cate/(\d*)/page/(\d*).html$ /phone/cates/$1/pages/$2/ permanent; break; } #Mobile homepage searchif ($request_uri ~* ^/Home/phone/index.html?(.*)) { rewrite ^/Home/phone/index.html(.*) /phone/index.html$1 permanent; break; } #Mobile book pageif ($request_uri ~* ^/home/phone/books/book/(\d*).html$) { rewrite ^/home/phone/books/book/(\d*).html$ /phone/books/$1/ permanent; break; } #Mobile chapter pageif ($request_uri ~* ^/home/phone/contents/books/(\d*)/chapters/(\d*).html$) { rewrite ^/home/phone/contents/books/(\d*)/chapters/(\d*).html$ /phone/books/$1/chapters/$2/ permanent; break; } if ($request_uri ~* ^/Home/book/(.*)$) { rewrite ^(.*)$ /index.php?s=$1 last; break; } if (!-e $request_filename) { return 404; } } Computer browser location /web { root html; index index.html index.htm; #If the device is a mobile phone or iPad if ($http_user_agent ~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)) { rewrite ^/web(.*) /phone$1 permanent; } #Computer homepage searchif ($request_uri ~ ^/web/search(.*)$) { rewrite ^(.*) /index.php?s=/Home/index/index.html last; break; } #Computer home page set $index false; if ($request_uri ~* ^/web$) { set $index true; } if ($request_uri ~* ^/web/$) { set $index true; } if ($index = true){ rewrite ^/web(.*) /index.php?s=/Home/index/index.html last; break; } #Computer home page paging set $index_page false; if ($request_uri ~* ^/web/pages/(\d*)$) { set $index_page true; } if ($request_uri ~* ^/web/pages/(\d*)/$) { set $index_page true; } if ($index_page = true){ rewrite ^/web/pages/(\d*)(.*) /index.php?s=/Home/index/index/page/$1.html last; break; } #Computer category homepage set $cate false; if ($request_uri ~* ^/web/cates/(\d*)$) { set $cate true; } if ($request_uri ~* ^/web/cates/(\d*)/$) { set $cate true; } if ($cate = true){ rewrite ^/web/cates/(\d*)(.*) /index.php?s=/Home/index/index/cate/$1.html last; break; } #Computer category paging set $cate_page false; if ($request_uri ~* ^/web/cates/(\d*)/pages/(\d*)$) { set $cate_page true; } if ($request_uri ~* ^/web/cates/(\d*)/pages/(\d*)/$) { set $cate_page true; } if ($cate_page = true){ rewrite ^/web/cates/(\d*)/pages/(\d*)(.*) /index.php?s=/Home/index/index/cate/$1/page/$2.html last; break; } #Computer book page set $book false; if ($request_uri ~* ^/web/books/(\d*)$) { set $book true; } if ($request_uri ~* ^/web/books/(\d*)/$) { set $book true; } if ($book = true){ rewrite ^/web/books/(\d*)(.*) /index.php?s=/Home/index/books/book/$1.html last; break; } #Computer chapter page set $chapter false; if ($request_uri ~* ^/web/books/(\d*)/chapters/(.*)$) { set $chapter true; } if ($request_uri ~* ^/web/books/(\d*)/chapters/(.*)/$) { set $chapter true; } if ($chapter = true){ rewrite ^/web/books/(\d*)/chapters/(.*)/ /index.php?s=/Home/index/contents/books/$1/chapters/$2.html last; break; } if (!-e $request_filename) { return 404; } } Mobile and tablet location /phone { root html; index index.html index.htm; #If the device is not a mobile phone or iPad if ($http_user_agent !~* (mobile|nokia|iphone|ipad|android|samsung|htc|blackberry)) { rewrite ^/phone(.*) /web$1 permanent; } #Computer homepage searchif ($request_uri ~ ^/phone/search(.*)$) { rewrite ^(.*) /index.php?s=/Home/phone/index.html last; break; } #Mobile homepage set $index false; if ($request_uri ~* ^/phone$) { set $index true; } if ($request_uri ~* ^/phone/$) { set $index true; } if ($index = true){ rewrite ^/phone(.*) /index.php?s=/Home/phone/index.html last; break; } #Mobile home page paging set $index_page false; if ($request_uri ~* ^/phone/pages/(\d*)$) { set $index_page true; } if ($request_uri ~* ^/phone/pages/(\d*)/$) { set $index_page true; } if ($index_page = true){ rewrite ^/phone/pages/(\d*)(.*) /index.php?s=/Home/phone/index/page/$1.html last; break; } #Mobile phone category homepage set $cate false; if ($request_uri ~* ^/phone/cates/(\d*)$) { set $cate true; } if ($request_uri ~* ^/phone/cates/(\d*)/$) { set $cate true; } if ($cate = true){ rewrite ^/phone/cates/(\d*) /index.php?s=/Home/phone/index/cate/$1.html last; break; } #Mobile phone category paging set $cate_page false; if ($request_uri ~* ^/phone/cates/(\d*)/pages/(\d*)$) { set $cate_page true; } if ($request_uri ~* ^/phone/cates/(\d*)/pages/(\d*)/$) { set $cate_page true; } if ($cate_page = true){ rewrite ^/phone/cates/(\d*)/pages/(\d*)(.*) /index.php?s=/Home/phone/index/cate/$1/page/$2.html last; break; } #Mobile book page set $book false; if ($request_uri ~* ^/phone/books/(\d*)$) { set $book true; } if ($request_uri ~* ^/phone/books/(\d*)/$) { set $book true; } if ($book = true){ rewrite ^/phone/books/(\d*)(.*) /index.php?s=/Home/phone/books/book/$1.html last; break; } #Mobile book paging page set $book false; if ($request_uri ~* ^/phone/books/(\d*)/pages/(\d*)$) { set $book true; } if ($request_uri ~* ^/phone/books/(\d*)/pages/(\d*)/$) { set $book true; } if ($book = true){ rewrite ^/phone/books/(\d*)/pages/(\d*) /index.php?s=/Home/phone/books/book/$1/page/$2.html last; break; } #Mobile chapter page set $chapter false; if ($request_uri ~* ^/phone/books/(\d*)/chapters/(.*)$) { set $chapter true; } if ($request_uri ~* ^/phone/books/(\d*)/chapters/(.*)/$) { set $chapter true; } if ($chapter = true){ rewrite ^/phone/books/(\d*)/chapters/(.*)/ /index.php?s=/Home/phone/contents/books/$1/chapters/$2.html last; break; } if (!-e $request_filename) { return 404; } } location ~ .xml(.*) { root html/ttt/; } location ~ .txt(.*) { root html/ttt/; } location ~ .gif(.*) { root html/ttt/; } location ~ .jpg(.*) { root html/ttt/; } location ~ .css(.*) { root html/ttt/; } location ~ .js$ { root html/ttt/; } location ~ .php$ { root html/ttt; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_buffers 8 256k; fastcgi_connect_timeout 300s; fastcgi_send_timeout 300s; fastcgi_read_timeout 300s; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: InnoDB type MySql restore table structure and data
>>: jQuery implements percentage scoring progress bar
Method 1: INSERT INTO t1(field1,field2) VALUE(v00...
Table of contents Node connects to Mysql Install ...
Table of contents Preface Active withdrawal Excep...
history route History mode refers to the mode of ...
1. Display the files or directories in the /etc d...
I think the carousel is a relatively important po...
Understanding of diff algorithm in React diff alg...
<br />When discussing with my friends, I men...
This tag is not part of HTML3.2 and only supports ...
Difference between HTML and XHTML 1. XHTML elemen...
First, let's look at an example of memory rel...
Some time ago, when I was working on a small func...
1. I downloaded QT5.13 version before, but after ...
Table of contents 1. Analysis of key source code ...
Tomcat CentOS Installation This installation tuto...