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

  • 相关阅读:
    美的书,献给所有追求美的人
    《WCF揭秘》:欢迎大家来找我的茬(有奖)!
    这个寒冬,如何让我们的身价翻倍?
    微软中文论坛周年Party掠影
    ASP.NET 3.5之屠龙刀——《ASP.NET高级程序设计(第2版)》
    Red Hat Linux指南
    一部孟宪会推荐的C#图解教程
    左菜单js效果
    分享图标
    谷歌hack
  • 原文地址:https://www.cnblogs.com/lbnnbs/p/8321451.html
Copyright © 2020-2023  润新知