一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

云服務器|WEB服務器|FTP服務器|郵件服務器|虛擬主機|服務器安全|DNS服務器|服務器知識|Nginx|IIS|Tomcat|

服務器之家 - 服務器技術 - Nginx - Nginx下支持Thinkphp URL Rewrite的配置示例

Nginx下支持Thinkphp URL Rewrite的配置示例

2019-10-29 17:00Nginx教程網 Nginx

這篇文章主要介紹了Nginx下支持Thinkphp URL Rewrite的配置示例,本文直接給出配置示例,需要的朋友可以參考下

概述

Nginx服務器現在已經成為相當流行的開源Web服務器,很多生產環境也都在使用Nginx服務器。現在做項目大多數時候都是在使用ThinkPHP,但是Nginx默認不支持ThinkPHP的pathinfo模式,需要進行一定的配置。

Nginx配置文件

  1. # 
  2. # The default server 
  3. # 
  4. server { 
  5.   listen    80 default_server; 
  6.   #server_name www.example.com; 
  7.   #charset koi8-r; 
  8.   #access_log logs/host.access.log main; 
  9.   # Load configuration files for the default server block. 
  10.   include /etc/nginx/default.d/*.conf; 
  11.   #location / { 
  12.   #  root  /usr/share/nginx/html; 
  13.   #  index index.html index.htm; 
  14.   #} 
  15.   location / { 
  16.  root      /var/www/project_name; 
  17.  index index.html index.php; 
  18.     if (!-e $request_filename){ 
  19.       rewrite ^(.*)$ /index.php?s=$1 last; 
  20.     } 
  21.   } 
  22.   error_page 404       /404.html; 
  23.   location = /404.html { 
  24.     root  /usr/share/nginx/html; 
  25.   } 
  26.   # redirect server error pages to the static page /50x.html 
  27.   # 
  28.   error_page  500 502 503 504 /50x.html; 
  29.   location = /50x.html { 
  30.     root  /usr/share/nginx/html; 
  31.   } 
  32.   # proxy the PHP scripts to Apache listening on 127.0.0.1:80 
  33.   # 
  34.   #location ~ \.php$ { 
  35.   #  proxy_pass  http://127.0.0.1; 
  36.   #} 
  37.   # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
  38.   # 
  39.   location ~ \.php$ { 
  40.     root      /var/www/project_name; 
  41.     fastcgi_pass  127.0.0.1:9000; 
  42.     fastcgi_index index.php; 
  43.     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
  44.     include    fastcgi_params; 
  45.   } 
  46.   # deny access to .htaccess files, if Apache's document root 
  47.   # concurs with nginx's one 
  48.   # 
  49.   #location ~ /\.ht { 
  50.   #  deny all; 
  51.   #} 

總結

做個備份,方便以后查看:)

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 男生同性视频twink在线 | 国产成人精品一区二三区在线观看 | 99视频免费在线观看 | 麻豆网站视频国产在线观看 | 娇女的呻吟亲女禁忌h16 | 护士伦理片 | 白丝超短裙被输出娇喘不停小说 | 初尝黑人巨大h文 | 国产成人精品视频频 | 日本免费三片在线观看 | 日本人成年视频在线观看 | 精品久久香蕉国产线看观看麻豆 | 92国产福利视频一区二区 | 亚洲精品有码在线观看 | 午夜性爽视频男人的天堂在线 | 国产亚洲一级精品久久 | 亚洲AV国产福利精品在现观看 | 国产青青操| 91天堂在线 | 婷婷激情综合五月天 | 校花被拖到野外伦小说 | 5566中文字幕亚洲精品 | 免费观看大片毛片 | 好姑娘在线视频观看免费 | 91香蕉国产在线观看免费永久 | 日韩欧美一区黑人vs日本人 | 日本视频在线播放 | 亚洲第一福利网 | 青苹果乐园影院免费观看完整版 | 草草影院在线 | 色综合网亚洲精品久久 | 朝鲜美女免费一级毛片 | 日韩亚洲人成在线综合 | 青草视频网站 | 被调教的校花 | 日本成人高清视频 | 色戒真做gif动图 | tkvk视频| 被教官揉了一晚上的奶小说 | 99热精品成人免费观看 | 538精品视频 |