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;
        }

  • 相关阅读:
    LeetCode——加油站
    LeetCode——分发糖果
    LeetCode——单词拆分 ii
    LeetCode—— 单词拆分
    LeetCode——重排链表
    IAR ARM、IAR STM8、IAR MSP430共用一个IDE
    OSAL多任务资源分配机制
    Win7系统Matlab2013a安装.m文件不自动关联到MATLAB.exe解决方法
    Java SE/ME/EE的概念介绍
    STL,ATL,WTL之间的联系和区别
  • 原文地址:https://www.cnblogs.com/lbnnbs/p/8321451.html
Copyright © 2011-2022 走看看