请选择 进入手机版 | 继续访问电脑版

thinkphp使用nginx系统伪静态规则

[复制链接]
查看2033 | 回复0 | 2020-12-3 11:01 | 显示全部楼层 |阅读模式
thinkphp使用nginx系统伪静态规则
  1. location /
  2.             {
  3.                 index index.php;
  4.                 #ThinkPHP REWRITE支持
  5.                 if (!-e  $request_filename) {
  6.                     rewrite ^/(.*)$ /index.php?s=$1 last;
  7.                 }
  8.                 #301 跳转设置
  9.                 if ($host = 'vc.cn') {
  10.                         rewrite ^/(.*) http://www.vc.cn/$1 permanent;
  11.                 }
  12.             
  13.             }        
  14.         location ~ [^/]\.php(/|$)
  15.             {
  16.                fastcgi_split_path_info  ^(.+?\.php)(/.*)$;
  17.                 if (!-f $document_root$fastcgi_script_name) {
  18.                         return 404;
  19.                 }
  20.                 fastcgi_pass   127.0.0.1:9002;
  21.                 fastcgi_index  index.php;
  22.                 fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  23.                 fastcgi_param  PATH_INFO        $fastcgi_path_info;
  24.                 fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
  25.                 include        fastcgi_params;
  26.             }
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-4-16