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

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

云服務器|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服務器?,F在做項目大多數時候都是在使用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.   #} 

總結

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

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 极品在线| 99综合网 | 好大好想要 | 欧美精品一区二区三区免费观看 | 亚洲国产精品自在自线观看 | 四虎影院永久网址 | 久久精品亚洲国产AV涩情 | 久草在线福利视频在线播放 | 免费看全黄特黄毛片 | caoporm国产精品视频免费 | 日本玖玖视频 | 草草草视频| 国产99精品视频 | 饭冈加奈子黑人解禁在线播放 | 操熟美女又肥又嫩的骚屁股 | 久久精品国产在热亚洲完整版 | 国产福利不卡视频 | 22sihu国产精品视频影视资讯 | 动漫人物差差插曲漫画 | 胸大的姑娘中文字幕视频 | 香蕉动漫库 | 华人亚洲欧美精品国产 | wwwav在线| 亚洲 综合 自拍 精品 在线 | 女人把扒开给男人爽 | 成年人免费观看的视频 | 97色伦| 亚洲第一区欧美日韩精品 | 扒开双腿羞辱调教play视频 | 特级一级全黄毛片免费 | 14一18cad中国大学生 | 国产视频一区二 | 日韩视频在线观看中字 | 日本公与妇中文在线 | 国产白白视频在线观看2 | 国产色综合久久五月色婷婷中文 | 玩两个少妇女邻居 | 欧美成人免费观看久久 | 好大好硬好湿好紧h | 亚洲天天做夜夜做天天欢 | 久久99精国产一区二区三区四区 |