国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > Nginx > 正文

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

2024-08-30 12:26:35
字體:
來源:轉載
供稿:網友

概述

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

Nginx配置文件

## The default server#server {  listen    80 default_server;  #server_name www.example.com;  #charset koi8-r;  #access_log logs/host.access.log main;  # Load configuration files for the default server block.  include /etc/nginx/default.d/*.conf;  #location / {  #  root  /usr/share/nginx/html;  #  index index.html index.htm;  #}  location / { root      /var/www/project_name; index index.html index.php;    if (!-e $request_filename){      rewrite ^(.*)$ /index.php?s=$1 last;    }  }  error_page 404       /404.html;  location = /404.html {    root  /usr/share/nginx/html;  }  # redirect server error pages to the static page /50x.html  #  error_page  500 502 503 504 /50x.html;  location = /50x.html {    root  /usr/share/nginx/html;  }  # proxy the PHP scripts to Apache listening on 127.0.0.1:80  #  #location ~ /.php$ {  #  proxy_pass  http://127.0.0.1;  #}  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000  #  location ~ /.php$ {    root      /var/www/project_name;    fastcgi_pass  127.0.0.1:9000;    fastcgi_index index.php;    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;    include    fastcgi_params;  }  # deny access to .htaccess files, if Apache's document root  # concurs with nginx's one  #  #location ~ //.ht {  #  deny all;  #}}

總結

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 桃江县| 交口县| 冀州市| 丹棱县| 长海县| 楚雄市| 双江| 柏乡县| 佛冈县| 泸州市| 佛学| 鲁甸县| 武胜县| 雷州市| 登封市| 杨浦区| 庄河市| 谷城县| 喀喇| 波密县| 金溪县| 江源县| 桂林市| 肃北| 昌黎县| 永定县| 西昌市| 句容市| 伊金霍洛旗| 平顶山市| 南安市| 阿拉善右旗| 新蔡县| 正蓝旗| 海口市| 利辛县| 贵定县| 门源| 天峻县| 肥乡县| 米泉市|