VPS侦探论坛

 找回密码
 注册
查看: 3086|回复: 3

军哥,lnmp1.3下面取消目录执行php方法失效了!

[复制链接]
发表于 2016-9-8 13:27:40 | 显示全部楼层 |阅读模式

之前一直用1.2的,可以使用,现在升级到1.3的了,在写这个进去,发现失效了,写了规则,依然可以执行php。

先贴上conf文件。


server
    {
        listen 80;
        #listen [::]:80;
        server_name www.230a.com 230a.com;

if ($host != 'www.230a.com') {rewrite ^/(.*)$ http://www.230a.com/$1 permanent;}

        index index.html index.php;
        root  /home/wwwroot/www.230a.com;


        include none.conf;
        error_page   404   /404.html;
        include enable-php.conf;
        

location ~ /images/.*\.(php|php5)?$


{


deny all;


}




location ~ .*\.(gif|jpg|jpeg|png)$

        {
            expires      30d;
        }


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


        location ~ /\.
        {
            deny all;
        }


        access_log  /home/wwwlogs/www.230a.com.log;
    }



从新启动nginx以后,依然可以运行php文件。。

/etc/init.d/nginx restart


[attachimg]3562[/attachimg]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-9-8 15:08:17 | 显示全部楼层


官网教程上有说明要放到php解析配置的前面
你这个明显php解析在前面,php脚本都解析了,后面加deny也没用了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-9-8 21:15:31 | 显示全部楼层

回复 2# 的帖子


谢谢军哥,抱歉,是我这边没有看清楚,1.3的跟1.2的不一样!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-9-9 09:26:47 | 显示全部楼层

回复 3# 的帖子




一样,只是让配置文件更简化,更新日志有说明 https://lnmp.org/changelog.html
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 23:27 , Processed in 0.027214 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表