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

  • 相关阅读:
    SDN实验2:Mininet 实验——拓扑的命令脚本生成
    2020软工实践第一次作业
    POJ2942-Knights of the Round Table
    POJ1966 ZOJ2182<无向图点连通度 Isap版>
    POJ1523(求割点)
    POJ2391(最大流Isap+Floyd+二分)
    POJ1087 ZOJ1157(最大流Isap+map映射)
    POJ1459(最大流Isap)
    数字的字符串处理 (转)
    POJ2112 最大流(Isap+Floyd+二分)
  • 原文地址:https://www.cnblogs.com/lbnnbs/p/8321451.html
Copyright © 2011-2022 走看看