国产探花免费观看_亚洲丰满少妇自慰呻吟_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;  #}}

總結

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 建湖县| 钟祥市| 柞水县| 丹棱县| 抚松县| 泊头市| 灵璧县| 南康市| 鹤峰县| 巴塘县| 得荣县| 东莞市| 图们市| 长葛市| 昌乐县| 陕西省| 湖州市| 嘉黎县| 恭城| 花垣县| 乌兰察布市| 基隆市| 云阳县| 新沂市| 平原县| 若尔盖县| 和硕县| 邢台县| 保山市| 肇州县| 宜君县| 上饶市| 阳原县| 襄城县| 抚顺县| 喜德县| 洛隆县| 新源县| 林周县| 昌邑市| 兴化市|