zoukankan      html  css  js  c++  java
  • LNMP 支持 ThinkPHP 的 pathinfo 模式

    注意使用LNMP 1.4版

    1、修改php.ini 启用pathinfo

    /usr/local/php/etc/php.ini

    cgi.fix_pathinfo = 0 值改为1

     

    2、修改/usr/local/nginx/conf/vhost/你的网站.conf 配置文件

    include enable-php.conf;  替换为 include enable-php-pathinfo.conf;

    注意包含thinkphp.conf的路由配置文件

     

    配置文件如下所示:

    server
        {
            listen 80;
            #listen [::]:80;
            server_name www.abc.com ;
            index index.html index.htm index.php default.html default.htm default.php;
            root  /www/abc;

            include thinkphp.conf;
            #error_page   404   /404.html;

            # Deny access to PHP files in specific directory
            #location ~ /(wp-content|uploads|wp-includes|images)/.*.php$ { deny all; }

            include enable-php-pathinfo.conf;

            location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
            {
                expires      30d;
            }

            location ~ .*.(js|css)?$
            {
                expires      12h;
            }

            location ~ /.well-known {
                allow all;
            }

            location ~ /.
            {
                deny all;
            }

            access_log  /home/wwwlogs/www.abc.com.log;
        }

  • 相关阅读:
    filter
    验证
    HTML5 canvas 内部元素事件响应
    canvas 椭圆
    计算2点角度
    复制pdf文字出来是乱码的一种可能的解决方案
    LaTeX Pdf to Word
    论文题录导入导出的困惑
    公式测试
    [LaTex]Visio文件转EPS文件[转]
  • 原文地址:https://www.cnblogs.com/lbnnbs/p/8321451.html
Copyright © 2011-2022 走看看